In a home screen widget no child views are shown, just a root LinearLayout with background
I'm designing a home screen widget. Layout is simple, I just began adding a views to it, but the problem is what only the container (LinearLayout, a background frame image) is drawn.
Here is the XML:
<?xml version="1.0" encoding="utf-8"?>
<Lin开发者_运维知识库earLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/widgetframe"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/wgt_1st_row_name"
android:textColor="#000000"
android:text="Some Name"
/>
</LinearLayout>
Current layout is only one I use, it's defined as initial in widget-provider, neither I change it programmatically via RemoteViews
.
What did I missed, why child TextView isn't drawn?
UPD: when using color instead of 9-patch PNG as background for LinearLayout
- everything is drawn correctly.
UPD2: The answer is here: Android background hides child view text
In a nutshell: don't use a 9-patch (or any png??) as background in a ListView
(or not only in it??). FrameView
with a ImageView
as a first layer - is the solution.
The answer is here: Android background hides child view text
In a nutshell: don't use a 9-patch (or any png??) as background in a ListView
(or not only in it??). FrameView
with a ImageView
as a first layer - is the solution.
精彩评论