Android的 - java.lang.UnsupportedOperationException:无法转换为维度:类型= 0×12 [英] Android - java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12
问题描述
我试图让我的Android应用程序的UI,但它崩溃和错误是
I'm trying to make a UI for my android application, but it crashes and error is
了java.lang.RuntimeException:无法启动活动
ComponentInfo {com.example.test / com.example.test.MainActivity}:
java.lang.UnsupportedOperationException:不能转换为维度:
键入= 0×12
"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 code
Here's my XML code
<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>
我在做什么错?任何想法?
What I'm doing wrong? Any ideas?
推荐答案
您已经在该行提供的无效的资源:
You've provided invalid resource at this line:
android:layout_marginTop="@+id/RadioButton03"
dimentions应该用于余量,例如
dimentions should be used for margin, e.g.
android:layout_marginTop="@dimen/margin_top"
这篇关于Android的 - java.lang.UnsupportedOperationException:无法转换为维度:类型= 0×12的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!