我有一个包含
的自定义ListView
所有这些都是陈词滥调并且有onClick方法。
今天,我将按钮更改为imageButtons,当我点击它们时,我的商家详细信息什么也没做。
这是我的xml文件。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/place_cell_bg" >
<ImageView
android:id="@+id/bussiness_item_image"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_margin="10dp"
android:scaleType="fitXY" />
<LinearLayout
android:id="@+id/bussiness_item_text_layout"
android:layout_width="120dp"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/bussiness_item_image"
android:orientation="vertical" >
<TextView
android:id="@+id/bussiness_item_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
<TextView
android:id="@+id/bussiness_item_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
<TextView
android:id="@+id/bussiness_item_telphone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right" />
</LinearLayout>
<LinearLayout
android:id="@+id/bussiness_item_buttons_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:orientation="vertical" >
<ImageButton
android:id="@+id/bussiness_item_call_button"
android:layout_width="match_parent"
android:layout_height="30dp"
android:descendantFocusability="blocksDescendants"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="@string/call_button_text" />
<ImageButton
android:id="@+id/bussiness_item_nav_button"
android:layout_width="match_parent"
android:layout_height="30dp"
android:descendantFocusability="blocksDescendants"
android:focusable="false"
android:focusableInTouchMode="false"
android:text="@string/nav_button_text" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toLeftOf="@+id/bussiness_item_text_layout"
android:layout_toRightOf="@+id/bussiness_item_buttons_layout"
android:orientation="vertical"
android:paddingLeft="15dp" >
<TextView
android:id="@+id/bussiness_item_food_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left" />
<TextView
android:id="@+id/bussiness_type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left" />
<TextView
android:id="@+id/bussiness_item_distance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left" />
</LinearLayout>
</RelativeLayout>