我在项目可视化方面遇到了一些麻烦。在 android 2.x 上,xml 填充屏幕,但在 4.x 中,它们覆盖了大约 50% 的屏幕,另外 50% 是全黑的。我认为使用 fill_parent 和 wrap_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="wrap_content"
android:orientation="vertical"
android:background="#0058A8" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#0058A8" >
<EditText
android:id="@+id/smsnumber"
android:layout_width="154dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="14dp"
android:layout_toLeftOf="@+id/btnRubrica"
android:ems="10"
android:inputType="phone" >
</EditText>
<Button
android:id="@+id/btnRubrica"
android:layout_width="119dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="@string/phone_book" />
</RelativeLayout>
<EditText
android:id="@+id/smstext"
android:layout_width="fill_parent"
android:layout_height="64dp"
android:inputType="textMultiLine" />
<DatePicker
android:id="@+id/datePicker1"
android:layout_width="fill_parent"
android:layout_height="138dp"
/>
<TimePicker
android:id="@+id/timePicker1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/start"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/start" />
</LinearLayout>