我是android開發新手。面對下面的問題,任何幫助讚賞。列表視圖頂部的按鈕不可點擊
我有列表視圖和頂部的三個按鈕。列表視圖項目是可點擊的,但沒有對按鈕點擊執行任何操作。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dip" >
<Button
android:id="@+id/sellers"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:focusable="false"
android:text="@string/sellers" />
<Button
android:id="@+id/buyers"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:focusable="false"
android:text="@string/buyers" />
<Button
android:id="@+id/addTicketButton"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:focusable="false"
android:text="@string/addTicket"
android:textSize="16sp" />
</LinearLayout>
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF" >
</ListView>
這裏是控制文件
這只是xml。你是否用代碼中的onClickListeners連接了這些按鈕? –
正如我所看到的,在你的xml文件中沒有問題,並且按鈕點擊和Listview點擊之間也沒有關係。 請發佈您的完整代碼與onClick事件的按鈕,以便我或任何人在這裏可以幫助你。 – Swapnil
@Nilesh你可以發佈你的java代碼嗎? – Mahfa