나는 ListView가 각 항목의 레이아웃으로 다음과 같은 한 :listview 항목이 처음에 비활성화되는 이유는 무엇입니까?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="horizontal"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TextView" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
</LinearLayout>
하지만 때마다 나는이 받고 있어요 :
당신이 볼 수 있듯이, 두 버튼도를 TextViews가 비활성화되어 있으므로 (모양을 확인하십시오). ListView의 각 개별 항목은 클릭 할 때 액션을 취합니다 (OnItemClickListener()를 정의했습니다). 유일한 문제는 (지금까지) 버튼과 텍스트 뷰의 모습입니다. main_layout.xml은 다음과 같습니다.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="0dp"
android:hint="Text empty"
android:text="TextView" />
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="9" >
</ListView>
</LinearLayout>
질문을 편집하고 ListView XML 레이아웃과 자바 클래스를 추가 할 수 있습니까? –
해제로 무엇을 의미합니까? listView 항목의 onItemclick이 트리거링하지 않는다고 말하고 싶습니까? –
내 질문을 편집했습니다. "장애인"이란 말은 당신이보고있는 것을 의미했습니다. 버튼의 "모양"은 내가 의미하는 바를 말해줍니다. –