我在右侧的每个ListView项目中放置了一个图像,在布局xml中,我将它的宽度和长度设置为20dip,类型很小,我发现很难点击它,导致图像只占用20 * 20浸,我希望它的长度不变,而其高度完全填充父, 我想:如何使图像更容易点击?
android:layout_width="20dip"
android:layout_height="fill_parent"
,但它不工作。
下面是我的xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/item"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="6dip"
android:background="#FFFFFF">
<ImageView android:id="@+id/avatar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="6dip"
android:src="@drawable/default_happy_face" />
<RelativeLayout
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_toRightOf="@id/avatar"
android:layout_toLeftOf="@+id/optionImg">
<!-- some stuff unrelated-->
</RelativeLayout>
<!-- v Pay attention here v -->
<ImageView android:id="@+id/optionImg"
android:layout_width="20dip"
android:layout_height="fill_parent"
android:layout_marginLeft="15dip"
android:paddingLeft="5dip"
android:adjustViewBounds="true"
android:background="@drawable/option_normal"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
如果你仔细观看为Android的Twitter客户端,你会发现,在每个ListView项的右侧的图像是相当容易点击(即使你有没有点击图片,但是例如在按钮上方说)。我想知道如何做到这一点。
twitter image http://www.freeimagehosting.net/uploads/889d10c435.png
任何一个?任何帮助?
不,实际上我直接利用来自Twitter的图像(我解压的APK,并获得图像),它是完全一样的大,因为它看起来,我不知道他们是否已经使ImageView的长度充满了父项,所以【ImageView】比它里面的【image】更大,通过我尝试过但仍然不知道该怎么做。 – DiveInto 2010-08-13 06:29:37