Question

I've got the following problem, hopefully I can make it clear when it does occur with the following figure.

Valid XHTML http://www.tricky.dds.nl/stackoverflow/tabs_problem.png.

I've got a app where an edittext is display just below the center of the screen. When I push on the EditText the softkeyboard is showing (1) which will slide the view slightly up, but the tabs are still visible. When the keyboard isn't dismissed but tab3 is pressed (2) the view will change to tab 3. When the keyboard is dismissed (3) the title bar is shown again but the view isn't slide back up.

The XML layout is as follows:

<TabHost android:id="@+id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TabWidget android:id="@android:id/tabs"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
    />

    ...

    </TabHost>
</LinearLayout>

Hopefully someone has an idea how to solve this problem.

Thanks in advance!

PS: The soft keyboard isn't shown the way is should in my emulator. (this doesn't affect the problem, because on my phone the behavior is the same.

PSS: I removed the content of the app in the figure because it isn't worth showing just yet. I didn't put any effort in the graphics yet.

Was it helpful?

Solution

To solve this problem I've placed the tabs inside a ScrollView. This way only the content of the tabs will scroll and not the tabs itself. When the keyboard is dismissed the contect will nicely Scroll down again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top