0
我有一个应用程序,有一个列表视图。我想将imageview放在listview的一部分上。当我为imageview设置onclick监听器时,没有任何反应。我如何使它可以使imageview是可点击的,而不是与imageview重叠的列表视图的区域。可点击的ImageView在列表视图
的ImageView的 “ID/imagemenu” 应该可以点击 XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_alignParentTop="true"
android:layout_height="wrap_content" >
<ImageView
android:id="@+id/imagemenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentLeft="true"
android:src="@drawable/menub" />
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:src="@drawable/header" />
<ImageView
android:id="@+id/imageView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/camerab" />
</RelativeLayout>
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true" >
</ListView>
</RelativeLayout>
你能告诉我们你的xml吗? – coder
好的,我发布了我的xml代码 – Samantha