2016-06-28 6 views
0

これは私のレイアウトに簡単です:とsoftkeyboard他のビューの上に

android:windowSoftInputMode="stateHidden|adjustResize" 

を私はのEditTextとsoftkeyboardをタッチすると:私はその活性のために、このプロパティを設定している

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 
tools:context="ir11.co.tsco.fll.MainActivity"> 

<ImageView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:background="@drawable/bear" 
    android:text="Hello World!" /> 


<EditText 
    android:layout_alignParentBottom="true" 
    android:layout_width="match_parent" 
    android:layout_height="50dp" 
    android:hint="Comment ..." 
    /> 
</RelativeLayout> 

マニフェストに表示され、imageViewのサイズが変更されました!またはアクティビティに次のプロパティを設定した場合:

android:windowSoftInputMode="stateHidden|adjustPan" 

ソフトキーボードが画像をプッシュします。

これは私が望むものではありません。 edittext + softkeyboardをImageViewを押し上げたりサイズを変更したりせずにやりたい

どうすればよいですか?

+0

スクロールビュー内に相対配置を配置します – silverFoxA

答えて

1

この

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.so3.MainActivity"> <ScrollView android:id="@+id/scroll" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bear" android:text="Hello World!" /> </ScrollView> <EditText android:layout_alignParentBottom="true" android:layout_width="match_parent" android:layout_height="50dp" android:hint="Comment ..." /> </RelativeLayout>

とアンドロイドの設定のようなものですか:あなたの活動ののonCreate(にもマニフェスト

にwindowSoftInputMode = "adjustResize")は、次のコードを追加します。

ScrollView sv = (ScrollView)findViewById(R.id.scroll); 
    sv.setEnabled(false); 
0

マニフェストのアクティビティタグ内に次の行を書きます。

<activity ........................ 
      android:windowSoftInputMode="stateHidden|adjustNothing"> 
関連する問題