편집 가능한 필드를 클릭하기 전까지 원하는 모양으로 보이는 레이아웃이 있습니다. 편집 가능한 필드를 클릭하면 소프트 키보드가 표시되고 모든 것을 스쿼시하여 내 레이아웃이 유실되며 일부 필드가 숨겨집니다. android:windowSoftInputMode="adjustNothing"
, android:windowSoftInputMode="adjustPan"
을 추가하고 내용을 에 넣고, 다른 컨테이너에 android:isScrollableContainer="false"
을 추가하고 다른 방법은 여기에서 포럼에 있지만 아무 것도 작동하지 않습니다. 키보드가 보이면 레이아웃을 고정시키는 다른 방법이 있습니까?편집 가능한 필드를 클릭하면 키보드 및 유적 레이아웃이 나타납니다.
수정 : 임시 수정을 찾았습니다. scrollview를 사용하여 전체 내용을 둘러싼 다음이 속성을 scrollview android:fillViewport="true"
으로 설정하면 여기에 대한 질문 (링크 atm 없음)을 발견했습니다. 상단 선형 레이아웃이 더 이상 스쿼시되지 않지만 맨 아래의 버튼은 여전히 키보드로 표시됩니다.
내 레이아웃
<?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="vertical"
android:padding="20dp">
<!-- Linear Layout that holds all Equipment information (List and Details) -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/linear_layout_border"
android:orientation="horizontal">
<!-- Linear Layout for Equipment List -->
<LinearLayout
android:id="@+id/equipment_list"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@android:color/darker_gray"
android:orientation="horizontal"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp">
<ListView
android:id="@+id/lvequipments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@android:color/transparent"
android:dividerHeight="1dp"
android:listSelector="@drawable/wash_count_list_item_states"/>
</LinearLayout>
<!-- End Linear Layout for Equipment List -->
<!-- Linear Layout for Equipment List Details - Hidden Until a primary equipment is selected-->
<LinearLayout
android:id="@+id/equipment_list_details"
android:orientation="vertical"
android:layout_height="match_parent"
android:layout_width="0dp"
android:layout_weight="1"
android:background="@android:color/background_light"
android:padding="15dp"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:baselineAligned="false"
android:visibility="invisible">
<!-- Linear Layouts for Unavailable fields -->
<LinearLayout
android:id="@+id/unavailable_count"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/work_order_wash_count_unavailable"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<CheckBox
android:id="@+id/unavailable_count_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:focusable="false" />
</LinearLayout>
<!-- End Linear Layout for Unavailable fields -->
<!-- Hidden EditText for unavailable reason -->
<EditText
android:id="@+id/unavailable_count_reason"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/work_order_wash_count_reason_unavailable"
android:visibility="gone"/>
<!-- Linear Layout for PLC replaced or reset -->
<LinearLayout
android:id="@+id/plc_replaced"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:text="@string/work_order_wash_count_plc_replaced"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<CheckBox
android:id="@+id/plc_replaced_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:focusable="false" />
</LinearLayout>
<!-- End Linear Layout for PLC replaced or reset -->
<!-- Linear Layout for Single Pass -->
<LinearLayout
android:id="@+id/single_pass_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|bottom"
android:text="@string/work_order_wash_count_single_pass"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<EditText
android:id="@+id/single_pass_count"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:imeOptions="actionNext"
android:inputType="number"
android:maxLines="1" />
</LinearLayout>
<!-- End Linear Layout for single pass -->
<!-- Linear Layout for Double pass -->
<LinearLayout
android:id="@+id/double_pass_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|bottom"
android:text="@string/work_order_wash_count_double_pass"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<EditText
android:id="@+id/double_pass_count"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:imeOptions="actionNext"
android:inputType="number"
android:maxLines="1" />
</LinearLayout>
<!-- End Linear Layout for Double pass -->
<!-- Linear Layout for Total pass -->
<LinearLayout
android:id="@+id/total_pass_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|bottom"
android:text="@string/work_order_wash_count_total_pass"
android:textSize="20sp" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<EditText
android:id="@+id/total_pass_count"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:gravity="right"
android:inputType="number"
android:maxLines="1" />
</LinearLayout>
<!-- End Linear Layout for Total pass -->
<Button
android:id="@+id/wash_count_save_button"
style="@style/body_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/work_order_wash_count_save_button_text"
android:layout_marginTop="20dp"
android:layout_gravity="bottom"/>
</LinearLayout>
<!-- End Linear Layout for Equipment List Details -->
</LinearLayout>
<!-- End Linear Layout for Equipment Section (List and Details) -->
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<Button
android:id="@+id/close_wash_counts"
style="@style/body_button"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:text="@string/close" />
</LinearLayout>
</LinearLayout>
죄송 나던 작업을 – wizloc