Ich stehe mit Problem Taste zeigt außerhalb des Bildschirms in RelativeLayout
. ImageView
skaliert das Bild nicht, um einem Button sichtbaren Platz zu geben.Wie kann ich RelativeLayout zum Bildschirm passen?
Was ich habe:
Was ich will:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical" >
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str"
android:textAppearance="@android:style/TextAppearance.Small"
android:textColor="?android:attr/textColorTertiary"
android:layout_centerHorizontal="true"
/>
<ru.mw.widget.DrawableImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:adjustViewBounds="true"
android:layout_centerHorizontal="true"
android:scaleType="centerCrop"
/>
<Button
android:id="@+id/processButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/str"
android:layout_below="@+id/imageView"
android:layout_centerHorizontal="true"
/>
Problem, wenn ich die Bildschirmausrichtung zu ändern: Wenn ich Arun C Thomas's method im Landscape-Modus alles verwenden ist ok, aber im Portrait-Modus Ich habe dieses (Bild von links/rechts Kanten abgeschnitten):
Was erwartet:
hinzufügen android: alignParentBottom auf Ihre Taste und Android: alignParentTop (beide = true), um Ihre Textview. Sie setzen im Moment keine Grenzen für Ihr ImageView. –