2017-05-07 15 views
0

ソフト入力を開いたときに赤い領域に相対レイアウトを表示するにはどうすればよいですか?私はadjustPanとadjustResize入力モードを試みたが、起こらなかった。何か案は?android-windowSoftInputMode issue

enter image description here


enter image description here

答えて

0

まず、manifest.xmlにであなたの活動にandroid:windowSoftInputMode="adjustResize"を追加します。

次に、以下のようなレイアウトを作成します。

  • 親として、
  • RelativeLayoutは2人の子供(ScrollViewおよび底面図)
  • 底面図aligned to bottomの内側に入れてください。
  • ScrollViewはボトムビューからaboveにあります。

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 
    <ScrollView 
     android:layout_above="@+id/bottomView" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     //scrollable content 
    </ScrollView> 

    <RelativeLayout 
     android:id="@+id/bottomView" 
     android:layout_alignParentBottom="true" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

     //your bottom content 
    </RelativeLayout > 
</RelativeLayout> 
+0

ありがとう!それは働いた –