我一直在关注Google提供的Tab标签示例.我正在尝试使用提供的XML布局来设置选项卡布局.
我使用此XML布局@ http://developer.android.com/guide/tutorials/views/hello-tabwidget.html
<?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="fill_parent" androID:layout_height="fill_parent"> <linearLayout androID:orIEntation="vertical" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent"> <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"> <TextVIEw androID:ID="@+ID/textvIEw1" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:text="this is a tab" /> <TextVIEw androID:ID="@+ID/textvIEw2" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:text="this is another tab" /> <TextVIEw androID:ID="@+ID/textvIEw3" androID:layout_wIDth="fill_parent" androID:layout_height="fill_parent" androID:text="this is a third tab" /> </FrameLayout> </linearLayout></TabHost>
每当我在Eclipse布局设计器中切换Layout选项卡时,我都会在Eclipse内收到NullPointerException:null错误.
当我尝试将TabHost和TabWidget拖放到空的布局文件中时,也会发生这种情况.
我究竟做错了什么 ?这看起来很简单.
解决方法:
发现它已经被记录为问题
http://code.google.com/p/android/issues/detail?id=2021
不管怎么说,还是要谢谢你
总结以上是内存溢出为你收集整理的android-布局中的TabHost NullPointerException全部内容,希望文章能够帮你解决android-布局中的TabHost NullPointerException所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)