2012-04-25 72 views
0

我的应用程序包含标题,编辑文本,列表视图和页脚 它工作正常......但是当软键盘打开edittext时,我的页脚出现。Android:当软键盘打开时,带有线性布局的页脚出现

我也在清单中设置了android:windowSoftInputMode =“adjustPan”。

我的布局如下

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:background="@drawable/middle_bg" 
android:focusable="true" 
android:focusableInTouchMode="true" 
android:orientation="vertical" > 

<RelativeLayout 
android:id="@+id/header1" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" > 

<include 
android:id="@+id/header2" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_alignParentTop="true" 
layout="@layout/header" /> 
</RelativeLayout> 

<TableLayout 
android:id="@+id/tbllayout" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_below="@id/header1" 
> 

<TableRow 
android:layout_gravity="left" 
android:background="@drawable/tit_bg" > 

<TextView 
android:id="@+id/lbltit" 
android:layout_gravity="center_vertical" 
android:layout_weight="2" 
android:gravity="center" 
android:text="Registered Websites" 
android:textSize="20dp" 
android:textStyle="bold" /> 
<Button 
android:id="@+id/btnAddNewRege" 
android:layout_gravity="center_vertical" 
android:layout_weight="3" 
android:background="@drawable/plus" 
android:gravity="left" /> 
</TableRow> 

<TableRow android:layout_width="fill_parent" > 

<View 
android:id="@+id/vwhr1" 
android:layout_width="fill_parent" 
android:layout_height="10dip" 
android:layout_span="2" /> 
</TableRow> 

<TableRow> 
<EditText 
android:id="@+id/txtSearch" 
android:layout_width="wrap_content" 
android:layout_height="match_parent" 
android:layout_gravity="center" 
android:background="@drawable/roundedtextview" 
android:hint="Search" 
android:textSize="13dp" 
android:width="280sp" 
/> 

<Button 
android:id="@+id/btnSearchMain" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_gravity="center" 
android:background="@drawable/search" 
android:gravity="center" /> 
</TableRow> 

<TableRow android:layout_width="fill_parent" > 

<View 
android:id="@+id/vwhr" 
android:layout_width="fill_parent" 
android:layout_height="10dip" 
android:layout_span="2" /> 
</TableRow> 
</TableLayout> 

<LinearLayout 
android:id="@+id/tblftr" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_alignParentBottom="true" 
android:isScrollContainer="true" 
> 

<TableLayout 
android:id="@+id/btnpanel" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:stretchColumns="*" > 

<TableRow 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:background="@android:color/black" 
> 

<Button 
android:id="@+id/btnSetting" 
android:layout_weight="1" 
android:background="@drawable/settings" 
android:width="40dp" /> 

<Button 
android:id="@+id/btnAboutUs" 
android:background="@drawable/about_us" 
android:width="100dp" /> 

<Button 
android:id="@+id/btnFeedback" 
android:background="@drawable/feedback" 
android:width="100dp" /> 
</TableRow> 

<TableRow> 
<include 
android:id="@+id/include1" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_alignParentBottom="true" 
android:layout_gravity="bottom" 
layout="@layout/footer" /> 
</TableRow> 
</TableLayout> 
</LinearLayout> 

<ListView 
android:id="@+id/lst" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:layout_above="@id/tblftr" 
android:layout_below="@id/tbllayout" 
android:cacheColorHint="@android:color/transparent" 
android:layout_centerHorizontal="true"  > 
</ListView> 

</RelativeLayout> 

请导

感谢&问候 美达

回答

0

你可以尝试把你的RelativeLayout在ScrollView。如果ListView未填满屏幕,则此功能可能无法正常工作,因为您必须在ScrollView内为RelativeLayout申报layout_width="wrap_content",并且这会将您的页脚置于ListView的正下方。

尝试一下,看看它是否适合你的模型。

+0

它不适合我... – user1355489 2012-04-25 09:30:05