我正在制作一个应用程序,我想显示图像列表。通常我可以显示图像。我用左右导航按钮显示了这些图像。以供参考。当我按左键显示上一个和右键显示下一个图像。但实际上我不会总是显示按钮,当我的指针去那里时,它必须可见。 否则只有图像必须显示。 任何想法请 而且我的图像都是不同的大小,我怎么能得到模拟器的大小?那么它很容易调整图像大小并设置在可绘制列表中。当我放置指针/触摸按钮时如何设置可见/不可见按钮?
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