开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜