我一直在尝试创建一个 xml 文件,将相对布局集成到选项卡式布局中。这是我的代码:
<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"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
<RelativeLayout
android:id="@+id/simpleMode
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
</RelativeLayout>
</LinearLayout>
</TabHost>
我收到了很多错误,但我似乎无法找到我的问题所在: 我的错误是 Relative Layout must be followed by > or/> 和 在 android:id="@+id/simpleMode
找不到与给定名称匹配的追索权如有任何帮助,我们将不胜感激,非常感谢!!
最佳答案
请注意你在 android:id="@+id/simpleMode
之后丢失了 "。所以你的 xml 文件出错了。只需放置并运行
关于android - XML 文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6751940/