EditText를 눌러서 ListFragment 내부에있는 "Your answer here ..."필드가 아래의 스크린 캡입니다. 사용할 수 없게 만든다. 텍스트 커서가 EditText 필드에 나타나면 빨리 사라지고 EditText 필드는 포커스를 잃습니다.ListFragment에있을 때 EditText보기의 포커스가 남아 있지 않음
관련된 스택 게시물이 거의 발견되지 않았으며 EditText에서 포커스를 훔쳤을 것으로 의심됩니다. 관련 게시물 here을 참조하십시오. 나는 또한 forcing focus에 게시물을 읽었지만 아무것도 의미가 없습니다.
표준 ListFragment 및 ArrayAdapter 코드를 사용하는 것이 훨씬 쉽지만 프로그래밍 방식으로 뷰를 작성할 수 있습니다. 이 목록은 사용자 입력에 따라 늘어나고 Android에서 제공하는 인프라로 쉽게 관리 할 수 있습니다.
아래 내 화면을 참조하십시오. 화면의 오른쪽에는 행에 대한 사용자 정의 레이아웃을 포함하는 ListFragment가 있습니다. 각 행에는 텍스트를 전송하기위한 EditText와 Button이 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<EditText
android:id="@+id/answer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Your answer here..."
android:maxLines="1"
android:singleLine="true"/>
<Button
android:id="@+id/answer_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Go" />
</LinearLayout>