In the main activity I build TabHost with 4 tabs. Tabs are built without problems, everything works. The transition is carried out on different activites. Code:

tabHost = (TabHost) findViewById(android.R.id.tabhost); TabHost.TabSpec Services2 = tabHost.newTabSpec("Services2"); TabHost.TabSpec tabServices = tabHost.newTabSpec("Services"); tabServices.setIndicator("Services"); tabServices.setContent(new Intent(this, ServicesActivity.class)); tabEvakautor.setIndicator("Services2"); Services2.setContent(new Intent(this, ServicesActivity.class)); tabHost.addTab(tabServices); tabHost.addTab(tabServices2); ... и т.д. Main.xml <TabHost xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:layout_height="fill_parent" android:layout_width="fill_parent" tools:context="com.example.ivanvovk.MainActivity" > <TabWidget android:id="@android:id/tabs" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/news_selector"> </TabWidget> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> </FrameLayout> </RelativeLayout> </TabHost> 

The problem is that in Activit Services (an activit consists of text fields, a lot of code, if necessary, I will give it) I get a type overlay. The tab viewer itself is not visible in this activation programmatically (here I mean the xml markup), but is visible as a display from the main activation (the tabServices itself). Tabcontent'a width is different on different devices, so it is not logical to make it static. How can I tell Avtiviti that at the bottom of the screen there is a view from TabWidget so that it does not "climb" there? I reread a lot of material, google is tired, I can not find a solution, tell me the options for where to dig?

    1 answer 1

    Try adding such an attribute to your frameLayout.

     android:layout_above="@android:id/tabs" 
    • Brilliant! Thanks for the help - Ivan Vovk