Android Studio No tab content FrameLayout found for id 问题修复
一、问题描述
这两天遇到一个无厘头的问题,使用FragmentTabHost时报错:No tab content FrameLayout found for id xxx……
首先代码肯定没问题,出现这个问题的话 eclipse 和 Android Studio 的解决方案不一样。
出错时xml文件的代码是这样的:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.cachecats.oldbook.activity.HomeActivity" >
<FrameLayout
android:id="@+id/activity_home_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" >
</FrameLayout>
<TextView
android:layout_width="match_parent"
android:layout_h

本文介绍了在遇到Android Studio中'No tab content FrameLayout found for id'错误时的解决方法。问题源于FragmentTabHost使用时的报错,可能由v4库版本引起。在eclipse环境下,通过替换v4库版本即可解决;而在Android Studio中,由于自带v4库无法直接删除,建议直接删除TabWidget相关代码来解决问题。
最低0.47元/天 解锁文章
3060

被折叠的 条评论
为什么被折叠?



