<?xml version="1.0" encoding="UTF-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background" >
<TabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/tabs" />
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@drawable/button"
android:divider="@drawable/dividerd" />
</RelativeLayout>
</TabHost>
</RelativeLayout>
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainpage);
System.out.println("..........after layout...........");
tabHost = getTabHost();
tabHost.addTab(tabHost.newTabSpec("Payment").setIndicator("Acticvity 1",getResources().getDrawable(R.drawable.homed))
.setContent(new Intent(this, Activity 1.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)));
请找到 xml 文件代码和活动代码。当我打开应用程序时,我看不到任何选项卡。请帮助我。像上面一样,我有 4 个这样的标签要显示,但它们都没有显示