开发者

Shape does not show

The shape background="@drawable/profile_rounded_top_shape" is not drawing, what am I missing??

<LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            background="@drawable/profile_rounded_top_shape"
            android:clickable="true">
            <TextView
                android:id="@+id/textView1"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="TextView"/>
        </LinearLayout>

==> profile_rounded_top_shape.xml <==

<?xml version="1.0" encoding="utf-8"?>

    <selector
        xmlns:android="http://schemas.android.com/apk/res/android">
        <item
            android:state_pressed="true"
            android:drawable="@drawable/profile_rounded_top_pressed" /> <!-- pressed -->
        <item
            android:drawable="@drawable/profile_rounded_top" /> <!-- default -->
    </selector>

==> profile_rounded_top.xml <==

<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#FFFFFF" />
    <stroke
        android:width="3dp"
        android:color="#FF000000" />
    <corners
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp" />
</shape> 

==> profile_rounded_top_pressed.xml <==

<shape
    xmlns:android="ht开发者_开发问答tp://schemas.android.com/apk/res/android">
    <solid
        android:color="#FFFFFF" />
    <stroke
        android:width="3dp"
        android:color="#FF000000" />
    <corners
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp" />
    <gradient
        android:startColor="#6633cc"
        android:endColor="#00ccff"
        android:angle="270" />
</shape> 


background="@drawable/profile_rounded_top_shape"

should have the android namespace in front of it:

android:background="@drawable/profile_rounded_top_shape"
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜