2014-02-21 3 views
0

У меня есть рамка и я поставил перед ней план. все прекрасно, но когда я выбрал текст в верхней части макета кадра, масштаб рамки переднего плана framelayout изменяется, показывая клавиатуру. мой код:андроид framelayout передний план изменен, когда отображается клавиатура

`<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:foreground="@drawable/gol" 
android:foregroundGravity="center|center_horizontal" 
android:orientation="vertical" > 

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" > 

    <RelativeLayout 
     android:id="@+id/rlsearch" 
     android:layout_width="fill_parent" 
     android:layout_height="48dp" 
     android:layout_marginBottom="10dp" 
     android:background="@drawable/searchback" > 

     <Button 
      android:id="@+id/buttonSearch" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:layout_marginRight="5dp" 
      android:background="@drawable/search" 
      android:focusable="false" 
      android:textSize="20sp" /> 

     <EditText 
      android:id="@+id/editTextSearch" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_alignParentLeft="true" 
      android:layout_centerVertical="true" 
      android:layout_marginLeft="5dp" 
      android:layout_marginRight="5dp" 
      android:layout_toLeftOf="@+id/buttonSearch" 
      android:background="@android:color/transparent" 
      android:hint="@string/HintSearch" 
      android:imeOptions="actionSearch" 
      android:lines="1" 
      android:singleLine="true" 
      android:textColor="@color/TextColor" 
      android:textColorHint="@color/HintColor" /> 

    </RelativeLayout> 

    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="fill_parent" 
      android:layout_height="100dp" 
      android:scaleType="fitXY" 
      android:src="@drawable/up" /> 

     <ListView 
      android:id="@+id/DynamicListView" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:layout_below="@id/imageView1" 
      android:cacheColorHint="#00000000" 
      android:divider="#00000000" 
      android:dividerHeight="10dp" 
      android:paddingBottom="10dp" 
      android:paddingLeft="10dp" 
      android:paddingRight="10dp" 
      android:paddingTop="10dp" > 
     </ListView> 
    </RelativeLayout> 
</LinearLayout> 

`

Так что же плохого в моем коде? Благодаря

ответ

0

О деятельности в манифесте, добавьте следующее:

android:windowSoftInputMode="adjustPan"

Объяснение: экранная клавиатура может быть установлен или в этом режиме (панорамирование) в прокручивает поле мы редактировали в поле зрения рядом с клавиатурой ИЛИ его можно установить в масштабе (по умолчанию), который пытается сжать все, чтобы весь макет все еще соответствовал клавиатуре.

+0

Спасибо, Это сработало для меня. Можете ли вы объяснить, что такое android: windowSoftInputMode = "adjustPan"? – mori

+0

см. Мое объяснение edit :) –