私はタブホストを持っています。
タブ A は A アクティビティを接続します。
A アクティビティのレイアウトには、Edittext、ボタン、およびリストビューがあります。
リストビューは baseadapter からカスタマイズされています。リストビューにはテキストビューが含まれますが、ボタンや画像はありません..など。
プログラムに入ると、リストビュー項目をクリックできます。
B subActivity を接続します。
しかし、戻るキーをクリックすると、(アクティビティに戻る)
リストビューのアイテムが機能せず、上または下にドラッグする必要があります。
アイテムはクリックコレクトになります。
私はいくつかの文学を検索しました。
追加しようとしていた
android:focusable="false"
android:focusableInTouchMode="false"
android:clickable="false"
or
descendantFocusability="blocksDescendants"
私の listview 、 linearlayout または textview で。
しかし、問題は存在します。
問題を解決するには?どうもありがとうございます。
私のAレイアウトは以下の通りです:
<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="match_parent"
android:background="@color/bgColor"
tools:context=".MainActivity" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="70dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="center"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:layout_weight="1"
android:gravity="center" >
<EditText
android:id="@+id/drugText"
android:layout_width="224dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:ems="10"
android:gravity="center_vertical|center"
android:hint="@string/searchHint1"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="3"
android:gravity="left" >
<Button
android:id="@+id/query"
style="@style/ButtonText"
android:layout_width="70dp"
android:layout_height="48dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:background="@drawable/blue_btn"
android:text="@string/search"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="@+id/linearLayout1" >
<ListView
android:id="@+id/drugList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true" />
</LinearLayout>
</RelativeLayout>
私のリストビューアイテムのレイアウトは以下の通りです:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/color_listview_border"
android:gravity="center"
android:minHeight="60dp" >
<TextView
android:id="@+id/drugNameTV"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="20sp" />
</LinearLayout>
</LinearLayout>