0

リストビューに新しいアイテムを作成するデータベースを作成しました。ListView には以下が含まれます。

1)テキストビュー

2)チェックボックス

3)テーブル行

TextView コードのみを作成するように依頼すると、次のようになります。

<?xml version="1.0" encoding="utf-8"?>
   <TextView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/text1" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dip"/>

次に、ListView アイテムを開くことができます。しかし、3 つすべてのコードを作成するように依頼すると、次のようになります。

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="4.54" >

        <CheckBox
            android:id="@+id/check"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:focusable="false"/>

     <TextView 
    android:id="@+id/text1" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="10dip"/>

    </TableRow>

</LinearLayout>

CheckBox と TextView 領域をクリックすると、ListItem を開くことができます。一列丸ごと開けません。行をクリックしたときに ListItem を開くにはどうすればよいですか?

4

1 に答える 1