2012-05-31 83 views
0

我有一個RelativeLayout作爲我的視圖的主要佈局。我已經設置了一個圖像作爲背景。我也在該視圖中添加了幾個EditText。我的問題是,當我開始編輯EditText並顯示鍵盤時,我的背景會向上滾動。我怎麼能解決這個問題? 這是我RelaviveLayout定義:我的佈局背景滾動Android

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/layoutPrincipal" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:focusable="true" 
    android:focusableInTouchMode="true" 
    android:background="@drawable/ciudad_hd_1" 
    android:orientation="vertical" > 
+0

你嘗試設置focusableInTouchMode到了嗎? –

+0

什麼是android:orientation =「vertical」在這裏做什麼? – Alexander

+0

設置focusableInTouchMode = true可以防止我的應用程序在運行時打開鍵盤。我試圖將它切換爲false,但它不起作用 – Alex

回答

2

嘗試在AndroidManifest.xml中日使用這個在你的活動標籤

<activity android:windowSoftInputMode="stateVisible|adjustPan" . . . > 
+0

非常感謝!這解決了我的問題=) – Alex