Java 图形布局和运行时上的奇怪问题
现在我只是创建一个简单的页面。但是,除了第一个文本视图外,没有弹出任何内容 我试图通过project>clean进行清理。奇怪的是,这只发生在这个xml上。其他人似乎在工作Java 图形布局和运行时上的奇怪问题,java,android,xml,eclipse,view,Java,Android,Xml,Eclipse,View,现在我只是创建一个简单的页面。但是,除了第一个文本视图外,没有弹出任何内容 我试图通过project>clean进行清理。奇怪的是,这只发生在这个xml上。其他人似乎在工作 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Background Color: "/>
<Spinner
android:id="@+id/Spinner"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Size: " />
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<RadioButton
android:id="@+id/small"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Small"
/>
<RadioButton
android:id="@+id/medium"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Medium"
/>
<RadioButton
android:id="@+id/large"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Large"
/>
</RadioGroup>
</LinearLayout>
<Button
android:id="@+id/Make_Changes"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Confirm"/>
</LinearLayout>
问题是因为到处都有“匹配父项”: 对于除父线性布局外的所有布局,请尝试使用layout\u width=“wrap\u content”和layout\u height=“wrap\u content”
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Background Color: "/>
<Spinner
android:id="@+id/Spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Size: " />
<RadioGroup
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<RadioButton
android:id="@+id/small"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Small"
/>
<RadioButton
android:id="@+id/medium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium"
/>
<RadioButton
android:id="@+id/large"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large"
/>
</RadioGroup>
</LinearLayout>
<Button
android:id="@+id/Make_Changes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Confirm"/>
</LinearLayout>
对于冗长的xml代码,我真的不喜欢在stackoverflow上发布类似的内容,但我真的没有主意了。