Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why keyboard appear after the TabBar?

In My application there is tabBar and the Edittext.

See below image:

Normal Screen:

enter image description here

And Image After press on edittext:

enter image description here

Now why this tabbar goes up with the keyboard. I want it to be remain fix at the bottom even if the user open the keyboard by pressing on edittext.

So what should i have to do ?

Please help e for that ?

My xml Layout for the TabBarMain activity is like below:

    <?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    >

    <LinearLayout
        android:id="@+id/LL1"
        android:orientation="vertical"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >

       <FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            />

      <TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:layout_gravity="bottom"
            android:layout_weight="0"/>

    </LinearLayout>

</TabHost> 

So please help me for that.

Thanks.

like image 246
Shreyash Mahajan Avatar asked Jan 31 '12 09:01

Shreyash Mahajan


3 Answers

Please use this

android:windowSoftInputMode="adjustPan"

in android menifest.xml file in your activity.

Example..

<activity
            android:name="Youractivity"
            android:windowSoftInputMode="adjustPan"/>
like image 94
Nikhil Avatar answered Nov 15 '22 10:11

Nikhil


set the following in your TabHost

android:isScrollContainer="false"
like image 33
waqaslam Avatar answered Nov 15 '22 08:11

waqaslam


add stateUnchanged in your activity attribute windowsoftinputmode in manifest file, as below:

 <activity android:name="Youractivity"
        android:windowSoftInputMode="stateUnchanged"/>
like image 29
jeet Avatar answered Nov 15 '22 10:11

jeet