여기 내 문제가 있습니다. 2 개의 EditText를 표시하는 매우 간단한 레이아웃이 있는데, 하나는 제목이고 다른 하나는 설명입니다. 다음은 XML 파일입니다 Android EditText에 초점이 맞춰지지 않았습니다.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="1">
<EditText
android:layout_width="match_parent"
android:layout_height="63dp"
android:id="@+id/title_field"
android:background="#ffffffff"
android:hint="@string/titleFieldHint"
android:padding="20dp"
android:textSize="8.5pt"
android:maxLines="1"/>
<View
android:layout_width="fill_parent"
android:layout_height="1dp"
android:background="@android:color/darker_gray"/>
<EditText
android:layout_width="match_parent"
android:layout_height="0dp"
android:id="@+id/description_field"
android:hint="@string/descriptionHint"
android:gravity="top"
android:padding="20dp"
android:scrollbars="vertical"
android:textSize="8.5pt"
android:background="#ffffff"
android:inputType="textMultiLine"
android:textIsSelectable="true"
android:focusableInTouchMode="true" android:layout_weight="1"/>
</LinearLayout>
나는이 레이아웃 키보드로 활동을 시작
이 title_field를 중심으로 보여주고, 그래서 작성하고 (키보드가 여전히 열려있는 동안) 다른 필드를 클릭하고 설명을 작성할 수 있습니다. 그러나 키보드를 숨기면 title_field를 클릭하지 않으면 description_field가 응답하지 않으므로 title_field를 클릭하지 않으면 다시 키보드에 표시되지 않습니다 (키보드). description_field는 나를 허용하지 않는 반면에 title_field는 상자 밖의 선택 항목 (상황 별 작업 표시 줄 포함)을 지원합니다. 심지어 선택합니다.나는 단지 안드로이드 개발을 시작했습니다. 내가 놓친 것이 있습니까?
레이아웃 높이가 설명'EditText'에 대한 0dp있는 코드를 사용할 수 있습니다. 그건 오타예요? – dharms
@dcharms 아니야. 필자는 실제로 그것을 match_parent에서 변경했으며, IDE (IntelliJ)는 0dp가 더 나은 성능을 가지고 있다고 말했다. –
무엇이 보이지 않습니까? 내가 이것을 실행할 때 키보드가 있거나 닫혀있을 때 두 Edittexts를 볼 수 있습니다. –