2016-06-28 6 views
0

いくつかの値を取得するボタンをクリックすると、このビューはより大きな垂直の2つのサブレイヤに分散されますLinearLayoutこのように:"subLayout"をAndroidで修正する方法

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:padding="10dp"> 

    <RelativeLayout 
     android:orientation="horizontal" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center_horizontal" 
     android:layout_weight="0.4"> 
     <EditText 
      android:layout_width="70dp" 
      android:layout_height="wrap_content" 
      android:inputType="number" 
      android:id="@+id/number1" /> 
     <EditText 
      android:layout_width="70dp" 
      android:layout_height="wrap_content" 
      android:inputType="number" 
      android:id="@+id/number2" 
      android:layout_below="@+id/number1" /> 
     <Button 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Calc!" 
      android:id="@+id/calcButton" 
      android:layout_below="@+id/number2"/> 
    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_gravity="center_horizontal" 
     android:layout_weight="0.6" 
     android:layout_alignParentBottom="true"> 
     <TextView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:text="Answer" 
      android:id="@+id/Answer" /> 
    </RelativeLayout> 
</LinearLayout> 

私の問題は、私は私のEditTextをクリックすることで、キーボードは答えのTextViewは、キーボードと「上書き」私のボタン(全体RelativeLayoutは、キーボードの次)に上がり、設定の方法があります表示されますRelativeLayoutは固定されているので、それはどこにあるのでしょうか? ここに何が起こっているのですか:

enter image description here RelativeLayoutを修正する方法はありますか?

+0

マニフェストにwindowSoftInputModeを指定しましたか? – sJy

答えて

0

Android Manifestファイルのアクティビティにandroid:windowSoftInputMode = "adjustPan"を設定してみてください。

+0

これはうまくいきませんでした。 –

+0

adjustPanはこのトリックを行っていたはずです。 "adjustNothing"を試してください – sJy

+0

Androidマニフェストでこれを設定すると、 ''タグを正しく追加することができますか? ''と同様です。その後、アプリケーションや何かを再構築する必要がありますか? –

関連する問題