开发者社区> 问答> 正文

为什么RadioButton在红米手机上不能跑 ?

报错:Error inflating class android.widget.RadioButton
把这段删了就能跑

 <RadioGroup
            android:id="@+id/rg_01"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:orientation="horizontal" >

            <RadioButton
                android:id="@+id/rb_01"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:checked="true"
                android:text="@string/rb_boy" />

            <RadioButton
                android:id="@+id/rb_02"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="5dp"
                android:text="@string/rb_girl" />
        </RadioGroup>

展开
收起
爵霸 2016-03-10 11:41:35 2010 0
1 条回答
写回答
取消 提交回答
  • xml没什么问题啊,你有没有在代码中调用与操作过对应的控件,如果有,并且在在其他的机型上是正常的,那么检查下版本是否一致,如果不一致可能是方法的问题,有些低版本的方法是有bug的,自己检查下

    2019-07-17 18:57:21
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
Tangram 立即下载
360手机卫士 插件化漫谈 立即下载
手机京东Crash自动分析处理系统 立即下载