http://www.vogella.de/articles/Android/article.html#first
9. Your first Android project
由於版本原因,
範列裡的
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<EditText android:layout_height="wrap_content" android:id="@+id/editText1"
android:layout_width="match_parent" android:text="EditText"></EditText>
<RadioGroup android:layout_height="wrap_content" android:id="@+id/radioGroup1"
android:layout_width="match_parent">
<RadioButton android:text="RadioButton"
android:layout_width="wrap_content" android:id="@+id/radio0"
android:layout_height="wrap_content" android:checked="true"></RadioButton>
<RadioButton android:text="RadioButton"
android:layout_width="wrap_content" android:id="@+id/radio1"
android:layout_height="wrap_content"></RadioButton>
</RadioGroup>
<Button android:text="Button" android:id="@+id/button1"
android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>
</LinearLayout>
會報錯,
將match_parent改為fill_parent才可以
本文详细介绍了如何解决Android开发中遇到的XML布局问题,特别是将`match_parent`改为`fill_parent`以避免报错。通过实例演示了如何使用`LinearLayout`、`EditText`、`RadioGroup`和`Button`组件,并提供了关键代码片段以帮助开发者快速上手。

767

被折叠的 条评论
为什么被折叠?



