android-布局中的TabHost NullPointerException

android-布局中的TabHost NullPointerException,第1张

概述我一直在关注Google提供的Tab标签示例.我正在尝试使用提供的XML布局来设置选项卡布局.我使用此XML布局@http://developer.android.com/guideutorials/views/hello-tabwidget.html<?xmlversion="1.0"encoding="utf-8"?><TabHostxmlns:android="http://schemas.android.com

我一直在关注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所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1092455.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存