请查看以下内容
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/sales_inqury_main_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SalesInqury" >
<LinearLayout
android:id="@+id/sales_inq_title_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:gravity="center"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:text="@string/sales_inqury"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:textSize="40sp" />
<ImageView
android:id="@+id/add_new_sales_inqury_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/textView1"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/textView1"
android:src="@drawable/add_2" />
</LinearLayout>
<EditText
android:id="@+id/search_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@id/sales_inq_title_layout"
android:layout_marginTop="10dp"
android:ems="8"
android:singleLine="true"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:hint="Search" >
</EditText>
<ImageView
android:id="@+id/alphabet_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@id/sales_inq_title_layout"
android:layout_alignTop="@+id/search_2"
android:layout_alignParentLeft="true"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:layout_marginLeft="10dp"
android:src="@drawable/open_alphabet" />
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:paddingBottom="5dp"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:layout_below="@+id/alphabet_order" >
<TableLayout
android:id="@+id/sales_inq_table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:stretchColumns="2"
>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_audio_online" />
<TextView
android:id="@+id/testWord"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="John Abbruzzi"
/>
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="0094 234 2345 890" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_audio_away" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lincon Burrows" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="0094 342 5567 216" />
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
<TableRow
android:id="@+id/tableRow4"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</TableRow>
</TableLayout>
</ScrollView>
<include layout = "@layout/activity_drop_down_menu"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
include
布局存在问题。每当用户触摸搜索EditText
并打开软键盘时,include
布局就会出现在键盘顶部,如下所示(请参阅键盘顶部的栏“^^^”文字。)我用红色突出显示它
以下是此include
布局的代码。
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SlidingDrawer
android:id="@+id/SlidingDrawer"
android:layout_width="wrap_content"
android:layout_height="250dp"
android:layout_alignParentBottom="true"
android:content="@+id/contentLayout"
android:handle="@+id/slideButton"
android:orientation="vertical"
android:alpha="0.7">
<LinearLayout
android:id="@+id/slideButton"
android:layout_width="fill_parent"
android:layout_height="20dp"
android:orientation="vertical"
android:clickable="true"
android:gravity="right"
android:background="@android:drawable/bottom_bar"
>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="^^^"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
<LinearLayout
android:id="@+id/contentLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dip"
android:background="@drawable/gradient_gray" >
<TextView
android:id="@+id/menu_add_inquiry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/add_inquiry"
android:textColor="#ffffff"
android:clickable="true"
android:onClick="onMenuItemClicked"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/menu_add_event"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/add_event"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/menu_additional_info"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/additional_info"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/menu_add_to_contacts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="5dp"
android:text="@string/add_to_contacts"
android:textColor="#ffffff"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</SlidingDrawer>
</RelativeLayout>
我不希望这个include
布局在打开时显示在键盘上。我怎么能这样做?
答案 0 :(得分:2)
将android:windowSoftInputMode="adjustPan|adjustResize"
添加到清单 - 到相应的活动:
<activity android:name="MyActivity"
...
android:windowSoftInputMode="adjustPan|adjustResize"
...
</activity>