0
我在父LinearLayout中使用TableLayout,並且我在TableLayout中有幾個EditText視圖。我完全茫然,爲什麼所看到下面的圖片中的EditText意見超過我的佈局的屏幕尺寸:破碎的Android佈局
這裏是我的XML代碼:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_view_edit_location_parameters"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.kg.hvacloadestimator.ViewEditLocationParameters">
<TextView
android:text="@string/Location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/location" />
<TextView
android:text="@string/Summer_Outside_db"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/summerDB" />
<TextView
android:text="@string/Winter_Outside_db"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/winterDB" />
<TextView
android:text="@string/Daily_Range"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/dailyRange" />
<CheckBox
android:text="@string/Checkbox_Custom_Conditions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onCheckboxClicked"
android:id="@+id/checkBoxCustomConditions" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:text="@string/Custom_Location"
android:layout_height="wrap_content"
android:id="@+id/textViewCustomLocation" />
<EditText
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:text="@string/Default_Custom_Location"
android:ems="10"
android:id="@+id/editTextCustomLocation" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:text="@string/Custom_Summer_db"
android:layout_height="wrap_content"
android:id="@+id/textViewCustomSummerDB" />
<EditText
android:layout_height="wrap_content"
android:inputType="numberSigned|numberDecimal"
android:ems="10"
android:id="@+id/editTextCustomSummerDB"
android:text="@string/Default_Custom_Summer_db" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:text="@string/Custom_Winter_db"
android:layout_height="wrap_content"
android:id="@+id/textViewCustomWinterDB" />
<EditText
android:layout_height="wrap_content"
android:inputType="numberSigned|numberDecimal"
android:ems="10"
android:id="@+id/editTextCustomWinterDB"
android:text="@string/Default_Custom_Winter_db" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:text="@string/Custom_Daily_Range"
android:layout_height="wrap_content"
android:id="@+id/textView4" />
<Spinner
android:layout_height="wrap_content"
android:id="@+id/spinnerCustomDailyRange" />
</TableRow>
</TableLayout>
<Button
android:text="@string/Button_Confirm_Location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onButtonClick"
android:id="@+id/buttonConfirmLocation" />
</LinearLayout>
任何幫助將不勝感激。先謝謝你。
這是'ems'屬性搞亂了佈局。謝謝! – KJG