1
形狀背景=「@ drawable/profile_rounded_top_shape」不是繪圖,我在想什麼?形狀不顯示
<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="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" />
<gradient
android:startColor="#6633cc"
android:endColor="#00ccff"
android:angle="270" />
</shape>
命名空間? '背景' - >'android:背景' –
天才。提交積分答案 – hunterp