关于android的id
2014-05-06 14:14
288 查看
当引用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>
相关文章推荐
- 关于com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536的解决方法
- 关于Android R文件的坑。本地图片资源id存了数据库,一开始显示正常,后来都乱序了。
- 关于Plugin with id 'com.github.dcendents.android-maven' not found.问题解决
- 关于Android开发中的view的id
- 关于Android Wifi NetworkId的一些理解。
- 关于获取设备的唯一设备ID,MAC地址 IOS/Android问题
- Android应用开发---关于SQL中通过cursor获取指定id的内容
- 关于Android项目打包过程中因为id重名导致的无法打包的问题
- Android 异常处理 - 关于E/HAL: load: id=gralloc != hmi->id=
- 关于android使用已有id,自己的id和系统id
- (转载)关于android:id="@+id/xx"的理解
- Android 随手笔记 关于id
- 关于android开发添加菜单XML文件之后无法在R.java中生成ID的问题
- 关于android.R.id.text1
- 关于android开发添加菜单XML文件之后无法在R.java中生成ID的问题
- 关于导入moudle遇到的错误Error:(2, 0) Plugin with id 'com.github.dcendents.android-maven' not found解决办法
- 关于Android 设置应用 ID applicationId
- 关于android开发添加菜单XML文件之后无法在R.java中生成ID的问题
- 关于android设备唯一区分device id的取得
- 关于Android开发中图片资源文件夹drawable中图片与资源ID号出现对不上的问题