Wie Sie in meinem Screenshot sehen können, sind Ansichten wie ein EditText übergelaufen oder verschwunden. Aus diesem Grund kann ich die Bildlaufleiste auf der rechten Seite eines mehrzeiligen EditText nicht sehen.Ansichten sind übergelaufen oder verschwunden in Android 5
Wie kann ich das beheben? Ich habe match_parent und fill_parent versucht, kann aber keinen Unterschied sehen. 'wrap_content' ist nicht nett für ein Formular.
Screenshot Android Studio, EditText overflows
Hier ist meine xml:
<?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:orientation="vertical"
tools:context=".MyActivity">
<GridLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2">
<TextView android:text="Label for first EditText" />
<EditText
android:id="@+id/et_id"
android:layout_width="match_parent"
android:lines="1"
android:maxLength="13"
android:maxLines="1" />
<TextView android:text="Another Label for another ET" />
<EditText
android:id="@+id/et_new_description"
android:layout_width="match_parent"
android:lines="3"
android:maxLines="10"
android:inputType="textMultiLine"
android:scrollbars="vertical" <!-- can't see this -->
android:scrollbarAlwaysDrawVerticalTrack="true"/>
</GridLayout>
<android.support.v7.widget.ButtonBarLayout
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentBottom="true">
<Button
android:id="@+id/button_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="@drawable/filter"
android:text="cancel" />
<Button
android:id="@+id/button_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:drawableLeft="@android:drawable/ic_menu_save"
android:text="save" />
</android.support.v7.widget.ButtonBarLayout>
</RelativeLayout>
Ihre Views brauchen sowohl 'layout_width' als auch' layout_height', zeigen Sie diese nicht oder werden sie in einem Stil oder etwas behandelt? – zgc7009
Es gibt keine weiteren Attribute. – EV221
@ EV221 Versuchen Sie es auf dem Gerät auszuführen. Manchmal rendert der Layout-Editor die Dinge nicht genau so, wie sie auf einem echten Gerät erscheinen. – Karakuri