其他分享
首页 > 其他分享> > Android使用TabHost时报错Your content must have a TabHost whose id attribute is 'android.R.id.tabhost

Android使用TabHost时报错Your content must have a TabHost whose id attribute is 'android.R.id.tabhost

作者:互联网

使用TabHost提示 Your content must have a TabHost whose id attribute is ‘android.R.id.tabhost’ 或者 Your TabHost must have a TabWidget whose id attribute is ‘android.R.id.tabs’ 等错误信息时。

  1. 改下TabHost的id。使用android:id="@android:id/tabhost",不要使用android:id="@+id/tabhost"
  2. 给TabWidget加id。android:id="@android:id/tabs"
  3. 给FrameLayout加上id。android:id="@android:id/tabcontent"

标签:whose,attribute,tabhost,TabHost,android,id
来源: https://blog.csdn.net/weixin_43219615/article/details/100134432