in der folgenden layout-datei überspannen, ich erstellt eine scrollView und es umfasst eine tableLayout. Die erste Zeile in der Tabelle ist ein Edittext. und trotz i EditText Ansicht Parameter sein, wie folgt:kann nicht erzwingen die edittext width auf dem bildschirm
android:layout_width="match_parent"
android:layout_height="wrap_content"
es reicht nie auf dem Bildschirm von links nach rechts !!
Bitte lassen Sie mich wissen, wie der Edittext über den Bildschirm von links nach rechts erstreckt?
Layout-
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity">
<!-- scrollView can host only one direct parent-->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableLayout
android:id="@+id/tl1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:id="@+id/tr0"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/et0"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</TableRow>
<TableRow
android:id="@+id/tr1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:weightSum="3"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_label_x1"
android:layout_weight="1">
<TextView
android:id="@+id/tv_label_x1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="x1: "/>
<TextView
android:id="@+id/tv_x1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@id/tv_label_x1"
android:text="x1value" />
</RelativeLayout>
</TableRow>
</TableLayout>
</ScrollView>
</RelativeLayout>
leider ist es nicht – user2121
Seltsamer arbeiten, um es für meine Umgebung (Emulator, Android 6) – nshmura
vielleicht weil im Original-Layout arbeitet, die die, die ich habe, ist, es sind extra drei Tablewars unterhalb der Edittext-Ansicht. sie sind etwas wie die folgenden: x1: x1value x2: x2value x3: x3value – user2121