3
목록보기가있는 작은 Android APP가 있습니다. 가끔 listview가 입력에 반응하지 않습니다. 하나의 항목을 만진 것을 볼 수 있지만 (터치 한 색상이 변경됨) 프로그램은 아무 것도하지 않습니다. 이 내 XML 파일입니다Android 목록보기 OnItemClickListener가 작동하지 않는 경우가 있음
.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(getApplicationContext(), "click", Toast.LENGTH_LONG).show();
}
});
누군가가 나에게 항상 작동하지 않는 이유 힌트를 줄 수 :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="false"
android:focusableInTouchMode="false" >
<TextView
android:id="@+id/textViewRowLable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textSize="50sp" />
<TextView
android:id="@+id/textViewTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_toRightOf="@id/textViewRowLable"
android:gravity="right"
android:textSize="25sp" />
<TextView
android:id="@+id/textViewRemainingTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/textViewTime"
android:layout_toRightOf="@id/textViewRowLable"
android:gravity="right"
android:textSize="25sp" />
</RelativeLayout>
이것은 청취자는?
는RelativeLayout
는 또한이 튜토리얼을 통해 이동 당신에
android:descendantFocusability="blocksDescendants"
를 사용하면
문제가 아직도있다. 10 건 중 2 건은 앱에 의해 감지되지 않습니다. 나는 이유를 모른다. – MasterCrumble
나는 똑같은 문제를 안고 그것을 이해하지 못했다. 이 문제를 일으키는 근본 원인을 찾았습니까? 고맙습니다. –