Q&A
###前提・実現したいこと
- フッターにボタンを表示させたい
- EditTextにフォーカスが当たった際にフッターのボタンを上げたくない。
EditTextにフォーカスが当たりソフトウェアキーボードが表示された際に、下部に固定しておきたい保存ボタンがソフトウェアの上に表示されてしまいます。
フッターのボタンが2段になる場合もあるため、保存ボタンをソフトウェアキーボードの裏に隠したいです。
どの様にレイアウトを組めばよいでしょうか?
###発生している問題・エラーメッセージ
###該当のソースコード
xml
1<?xml version="1.0" encoding="utf-8"?> 2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:tools="http://schemas.android.com/tools" 4 android:id="@+id/activity_settigs" 5 android:layout_width="match_parent" 6 android:layout_height="match_parent" 7 android:orientation="vertical" 8 tools:context=".SettingsActivity"> 9 10 <ScrollView 11 android:layout_width="match_parent" 12 android:layout_height="0dp" 13 android:layout_weight="1"> 14 15 <LinearLayout 16 android:layout_width="match_parent" 17 android:layout_height="match_parent" 18 android:orientation="vertical"> 19 20 <TextView 21 android:layout_width="match_parent" 22 android:layout_height="wrap_content" 23 android:text="設定1" /> 24 25 <EditText 26 android:id="@+id/setting1" 27 android:layout_width="match_parent" 28 android:layout_height="wrap_content" /> 29 30 <TextView 31 android:layout_width="match_parent" 32 android:layout_height="wrap_content" 33 android:text="設定2" /> 34 35 <EditText 36 android:id="@+id/setting2" 37 android:layout_width="match_parent" 38 android:layout_height="wrap_content" /> 39 40 <TextView 41 android:layout_width="match_parent" 42 android:layout_height="wrap_content" 43 android:text="設定3" /> 44 45 <EditText 46 android:id="@+id/setting3" 47 android:layout_width="match_parent" 48 android:layout_height="wrap_content" /> 49 50 <TextView 51 android:layout_width="match_parent" 52 android:layout_height="wrap_content" 53 android:text="設定4" /> 54 55 <EditText 56 android:id="@+id/setting4" 57 android:layout_width="match_parent" 58 android:layout_height="wrap_content" /> 59 </LinearLayout> 60 </ScrollView> 61 62 <Button 63 android:layout_width="match_parent" 64 android:layout_height="wrap_content" 65 android:text="保存" /> 66</LinearLayout>
###試したこと
該当のlayoutのxmlとAndroidManifest.xmlをいじって見ましたが
xml
1 <Button 2 android:layout_width="match_parent" 3 android:layout_height="wrap_content" 4 android:gravity="bottom" 5 android:text="保存" />
xml
1 <activity 2 android:name=".SettingsActivity" 3 android:screenOrientation="portrait" 4 android:windowSoftInputMode="adjustResize" />
###補足情報(言語/FW/ツール等のバージョンなど)
Kitkatの実機とlolipoのエミュレータで確認中。
回答1件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。
2017/04/04 05:02
2017/04/04 05:04
2017/04/04 05:05
2017/04/04 06:03
2017/04/04 06:12
2017/04/04 06:24
2017/04/04 06:28