我正在製作一個應用程序,我想顯示圖像列表。通常我可以顯示圖像。我用左右導航按鈕顯示了這些圖像。以供參考。當我按左鍵顯示上一個和右鍵顯示下一個圖像。但實際上我不會總是顯示按鈕,當我的指針去那裏時,它必須可見。 否則只有圖像必須顯示。 任何想法請 而且我的圖像都是不同的大小,我怎麼能得到模擬器的大小?那麼它很容易調整圖像大小並設置在可繪製列表中。當我放置指針/觸摸按鈕時如何設置可見/不可見按鈕?
code for left button:
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/bttn"
android:layout_alignBottom="@+id/bttn"
android:layout_alignParentRight="true"
android:onClick="ClickHandler2"
android:background="@drawable/android_lbutton"
/>
in drawable/android_lbutton
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/timthumb6"
android:state_pressed="true" />
<item android:drawable="@drawable/timthumb3"
android:state_focused="true" />
<item android:drawable="@drawable/timthumb8" />
</selector>
這裏timthumb6,timthumb3,timthumb8與差異顏色的三個按鈕左側。
把完整的xml代碼 – waqaslam