Ich habe ein einfaches GridLayout
:Android Grid fill_horizontal geht Off-Screen-
<GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="1" >
<TextView
android:layout_column="0"
android:layout_row="0"
android:text="Label"/>
<EditText
android:inputType="text"
android:layout_column="1"
android:layout_row="0"
android:text="asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf"
android:layout_gravity="fill_horizontal"/>
</GridLayout>
jedoch dies die EditText
bewirkt, dass der Bildschirm verlängern ab, wie aus der IDE unten (Bild gesehen werden, aber es macht das gleiche, wenn auf einem Gerät laufen).
Es scheint, dass die EditText
tatsächlich die volle Breite des Bildschirms ist eher als die Breite der GridLayout
Zelle, weshalb es Off-Screen wird. Was ist falsch im Layout passiert, um dies zu verursachen?
http://stackoverflow.com/questions/30845440/edittext-getting-out-of-gridlayout siehe diese – KrishnaJ