关于android的id
16lz
2021-12-04
当引用Android的资源ID(非本地资源ID)时,必须机上android包名,使用TabHost控件时就要如此操作:
When referencing an Android resource ID, you do not need the plus-symbol, but must add the android package namespace, like so:
引用 android:id="@android:id/empty"
With the android package namespace in place, we're now referencing an ID from the android.R resources class, rather than the local resources class.
<?xml version="1.0" encoding="utf-8"?><TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:padding="5dp" > <TabWidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="5dp" /> </LinearLayout></TabHost>
更多相关文章
- Android中的五大布局
- android 控件属性大全
- 【Android】Android控件之Seekbar拖动条的使用
- Android常用布局属性
- 周记:Class4
- Android(安卓)RelativeLayout 属性
- android找不到图片资源
- Android如何引用其他工程
- android linearlayout 把控件view置底部(放在页面最下方)