I have a widget layout as follow :
<?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创建)