이미 비슷한 질문을 읽었지만 문제가 해결 된 해결책이 없으므로 중복으로 표시하지 마십시오. EditText가 ListView에서 포커스를 잃음
은 내가ListFragment
custom ArrayListAdapter
을 통해 채워진
ListView
를 포함
FrameLayout
로모그래퍼 있습니다. 목록의 각 행에는
Checkbox
, EditText
및 ImageButton
의 세 가지 요소가 있습니다.
내 문제는 내가 EditText
을 변경하면 키보드가 포함되어 있지만 초점이 즉시 사라져서 쓸 수 없음을 나타냅니다.
나는 이미 manifest
파일에 내 Activity
에
안드로이드를 추가 한 점에 유의하시기 바랍니다 : windowSoftInputMode = "adjustResize"
을 심지어
안드로이드 : descendantFocusability = " afterDescendants " android : descendantFocusability ="beforeDescendants "
이 문제를 해결하지 못합니다. 여기
내 XML 코드 :row_item.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/item_checkbox"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
/>
<EditText
android:id="@+id/item_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="60px"
android:text="Test text"
android:singleLine="true"
android:layout_toRightOf="@id/item_checkbox"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/item_important"
android:layout_toStartOf="@+id/item_important" />
<ImageButton
android:id="@+id/item_important"
android:layout_width="20dip"
android:layout_height="20dip"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:visibility="visible"
android:layout_marginLeft="10dp" />
</RelativeLayout>
fragment_list.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp"
>
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</FrameLayout>
어디 방법을 이해하는 방법 좀 자원을 제안 할 수 있다면 그것은 좋은 것입니다 이 경우에는 집중력이 작용합니다.
는 당신에게 감사나는 문제가 나타나지 키보드에 의해 생성된다 발견
업데이트 : 내가보기 재활용이 EditText
포커스를 잃을 이유입니다 같아요.
가능한 중복의 문제 http://stackoverflow.com/questions/2679948/focusable-edittext-inside-listview – Abdellah
했다 보인다 ... – Alessandro91