4

次のようなウィジェットレイアウトがあります:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/widget_bg">
<TextView android:layout_height="fill_parent"
 android:layout_width="fill_parent"
 android:id="@+id/widgetText"
 android:text="@string/sWaitingForLocation"
 android:layout_marginLeft="4dip"
 android:layout_marginRight="4dip"
 android:layout_marginTop="4dip"
 android:layout_marginBottom="4dip"
 android:textStyle="bold"
 android:gravity="center">
</TextView>
</LinearLayout>

しかし、背景の後ろに隠れているように、テキストは表示されません。

私の背景は 9patch png です。android:background="android:color/black" を使用すると機能します...それは私の png でしょうか? (Android ツール draw9patch を使用して作成)

4

3 に答える 3

3

これも問題の解決策になる可能性があります: Android background hides child view text。9-patch の何が問題で、どのように修正したか教えていただけますか?

于 2010-09-06T13:30:17.500 に答える
0

私は問題を発見しました:私のninepatch pngが台無しになりました。

于 2010-08-24T20:56:20.290 に答える
0

思いつく可能性:

  • テキストの色は、ドローアブルと同じではありませんか?
  • 表示するテキストはありますか?
于 2010-08-20T16:23:05.180 に答える