0
私のAndroidフラグメントは、サポートGridLayoutを使用して等間隔のビュー(最初の画像)を表示しています。それは私がのEditTextとキーボードをタップしたときのGridLayoutのサイズを変更して、私のマニフェストでは、私はどのようにソフトキーボードが表示を変更しています(第2画像)が表示されます。キーボードを隠してサイズ調整した後、GridLayoutがリセットされない
android:windowSoftInputMode="adjustResize|stateHidden"
ソフトキーボードが表示されていない場合は、GridLayoutのはありません初期サイズ(最後の画像)にリセットされません。
GridLayoutには、最初のスクリーンショットで元の設定に戻って取得する方法上の任意のアイデア?問題が解消するマニフェストからandroid:windowSoftInputMode
を削除するとわかりますが、このデモが作成された別のアプリで変更することはできません。
はここフラグメントのレイアウトファイルです:
<android.support.v7.widget.GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:grid="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
grid:columnCount="2"
grid:rowCount="3"
grid:orientation="horizontal">
<EditText
android:layout_width="100sp"
android:layout_height="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:text="B"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:text="C"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:text="D"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:text="E"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="80sp"
grid:layout_gravity="center"
grid:layout_columnWeight="1"
grid:layout_rowWeight="1"
android:text="F"/>
</android.support.v7.widget.GridLayout>