1
私はListView
の各行にテキストとcheckbox
があるようにしています。リストビューをクリックすると、これが行われたことをチェックするかチェックを外しますが、checkbox
のフォーカスを無効にしたい、つまり、checkbox
のコードではなく、優先度をcheckbox
とlistview
とします。あなたの項目のレイアウトXMLでandroidのlistviewのチェックボックスのフォーカスを取り除く方法
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/checkbox"
android:layout_margin="@dimen/login_field_margin"
android:layout_alignParentRight="true"
android:focusable="false"
android:selectAllOnFocus="false"
android:focusableInTouchMode="false"
/>
<ListView android:layout_height="match_parent"
android:layout_width="match_parent"
android:id="@id/listView"
android:dividerHeight="0.25dp"
android:focusable="true"
android:divider="@color/colorDarkgrey"
android:background="@color/colorwhite"> </ListView>
私にこのサンプルを提供することができます –
plsはいくつかの例を提供しています –
ありがとうございました、この1行は機能しました。 – zeeshan