5

I have the following TabHost layout:

<?xml version="1.0" encoding="iso-8859-1"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_margin="0dp"
    android:padding="0dp" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_margin="0dp"
        android:background="@drawable/main_app_background"
        android:orientation="vertical"
        android:padding="0dp" >

        <ImageView
            android:id="@+id/logo"
            android:layout_width="fill_parent"
            android:layout_height="@dimen/site_logo_height"
            android:layout_margin="0dp"
            android:background="@color/tab_subtitle_background"
            android:padding="0dp"
            android:src="@drawable/barlogo" />

        <FrameLayout
            android:id="@+id/tab_subtitle"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:gravity="center"
            android:padding="0dp" />

        <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_gravity="center"
            android:layout_margin="0dp"
            android:layout_weight="99"
            android:padding="0dp" />

        <Button
            android:id="@+id/btn_save"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginRight="15dp"
            android:layout_marginTop="7dp"
            android:focusableInTouchMode="true"
            android:imeOptions="actionNext"
            android:tag="done"
            android:text="Ok" />

        <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_margin="0dp"
            android:layout_weight="1"
            android:padding="0dp" />
    </LinearLayout>

</TabHost>

The thing is, when the soft-keyboard appears both the Button and the TabWidget move up.

My objective is to keep the TabWidget on the bottom (below the soft-keyboard) and let the Ok button move up (on the top of the keyboard). Is it possible?

Thanks in advance!

jnthnjns
  • 8,962
  • 4
  • 42
  • 65
josetapadas
  • 2,589
  • 3
  • 19
  • 19

2 Answers2

1

try this may be it is use full adjust manifest

<activity
  android:windowSoftInputMode="adjustResize"              
  android:name=".youractivity" android:label="@string/app_name" >

see move up text view only when virtual keyboard open on android

Community
  • 1
  • 1
NagarjunaReddy
  • 8,621
  • 10
  • 63
  • 98
  • I am already using `android:windowSoftInputMode="adjustResize"` . But what I wanted, when the soft-keyboard pops up, was to keep the TabWidget below the keyboard (fixed at the bottom), and the Button to move with the keyboard (as it is now, using the ajustResize). – josetapadas Oct 15 '12 at 15:08
0

Try this in your manifest file:

<activity
    android:windowSoftInputMode="adjustPan"              
    android:name=".MainActivity" android:label="@string/app_name" >
Yogesh Somani
  • 2,624
  • 3
  • 21
  • 34