1
任何人都可以提供選擇器文件的背景按鈕。按下按鈕後,背景圖像會改變。我將爲按鈕的背景設置自定義圖像。什麼是可繪製文件listbackground
的內容?按鈕背景的選擇器文件
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:text="Button 1"
android:background="@drawable/listbackground"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button1"
android:layout_below="@+id/button1"
android:layout_marginTop="37dp"
android:text="Button 2"
android:background="@drawable/listbackground"/>
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/button2"
android:layout_centerVertical="true"
android:text="Button 3"
android:background="@drawable/listbackground"/>
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/button3"
android:layout_below="@+id/button3"
android:layout_marginTop="48dp"
android:text="Button 4"
android:background="@drawable/listbackground"/>
</RelativeLayout>
你有什麼問題嗎? – Raptor 2013-10-31 02:33:55
@ShivanRaptor我想要選擇器文件的代碼作爲按鈕的背景。當我們按下按鈕時,背景圖像會改變。這是一個自定義圖像。 – 2013-10-31 04:46:54
@ShivanRaptor我認爲這個問題現在很清楚,現在的問題還不清楚? – 2013-11-06 11:09:37