tabhost - order of view children changed in LinearLayout
I can't seem to fix what ought to be a simple problem with my TabHost layout. I construct the xml, as in the docs:
<?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="fill_parent">
<LinearLayout
android:orientation="vertical"
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">
</TabWidget>
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@+id/favouriteslist"
style="@style/POITab_Lists">
</ListView>
<ListView android:id="@+id/recentlist"
style="@style/POITab_Lists">
</ListView>
</FrameLayout>
</LinearLayout>
</TabHost>
and yet my FrameLayout appears before my TabWidget, crowding it out:
This seems quite unusual to me - does anyone have any ideas?
You mean it appears above in Hierarchy Viewer drawing? That seems quite a normal for me - this utility draws in this view XML tree hierarchy, not the layout itself. If everything in the Graphical Layout is ok (TabWidget is above FrameLayout) then you have nothing to worry about :)
精彩评论