Android – java.lang.UnsupportedOperationException:无法转换为dimension:type = 0x12
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Android – java.lang.UnsupportedOperationException:无法转换为dimension:type = 0x12,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2344字,纯文字阅读大概需要4分钟。
内容图文
![Android – java.lang.UnsupportedOperationException:无法转换为dimension:type = 0x12](/upload/InfoBanner/zyjiaocheng/744/71fb383312a94656829105f1eca8e501.jpg)
我正在尝试为我的Android应用程序创建一个UI,但它崩溃了,错误就是
“java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.test/com.example.test.MainActivity}:
java.lang.UnsupportedOperationException: Can’t convert to dimension:
type=0x12”
这是我的XML代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ff000000"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
<EditText
android:id="@+id/symbolName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapCharacters"
android:textColor="#ffffffff" >
</EditText>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:orientation="vertical" >
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
<RadioButton
android:id="@+id/RadioButton01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
<RadioButton
android:id="@+id/RadioButton02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
<RadioButton
android:id="@+id/RadioButton03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
</LinearLayout>
<LinearLayout
android:id="@+id/condition"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="@+id/RadioButton03">
<EditText
android:inputType="number"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Add Alert"/>
</LinearLayout>
我做错了什么?有任何想法吗?
解决方法:
您在此行提供了无效资源:
android:layout_marginTop="@+id/RadioButton03"
尺寸应该用于保证金,例如
android:layout_marginTop="@dimen/margin_top"
内容总结
以上是互联网集市为您收集整理的Android – java.lang.UnsupportedOperationException:无法转换为dimension:type = 0x12全部内容,希望文章能够帮你解决Android – java.lang.UnsupportedOperationException:无法转换为dimension:type = 0x12所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。