こんにちは私はXMLファイルに2つのレイアウトと各レイアウトの1つのテキストビューを持つリストビューを作成しました。テキストビューでは、これは私がリストビューのために取得していた行のために私のコードです:私が選択した項目のリストビューに一つだけのボックスを選択しようとしているときdiffcultyリストビューから項目を選択する
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:weightSum="2"
android:orientation="horizontal">
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/purple"
android:layout_weight="1"
android:id="@+id/rl1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff" />
</RelativeLayout>
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/purple"
android:layout_weight="1"
android:id="@+id/rl2">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/textView2"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:textColor="#ffffff" />
</RelativeLayout>
</LinearLayout>
今、私の問題であり、ポジションを切り替えると同じ位置に2つのボックスが表示されますので、どのボックスを選んでいるのかは関係ありません。Iv'eは線形レイアウトIDを与え、その上でクリックリスナーにセットを使用しようとします成功なしで、私は感謝し、提案します。
私はあなたが望むと思うのは、あなたがそれを必要とするならば、あなたが望みたくない視界を隠す必要があるかどうかと、目に見える視界を隠す必要がある場合です。あなたのアダプタでこれを行う必要があります –