2017-08-07 6 views
0

Ich habe ein Layout erstellt. Aber unten ist noch ein weißer Raum. Ich möchte den Inhalt des relativen Layouts ganz unten auf dem Bildschirm sehen. d. h. Suchleiste und Schaltfläche am unteren Rand.Layout passt nicht zum Bildschirm

<?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:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical" 
android:background="@drawable/images"> 

<com.example.acer.myapplication.ZoomView 
    android:id="@+id/iop" 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:gravity="center"/> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 
    <SeekBar 
     android:id="@+id/seekBar7" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 
    <Button 
     android:id="@+id/button61" 
     android:layout_width="50dp" 
     android:layout_height="50dp" 
     android:layout_below="@id/seekBar7" 
     android:layout_centerInParent="true" 
     android:background="@drawable/play" /> 
</RelativeLayout> 
</LinearLayout> 

Ich möchte, dass der Leerraum am unteren Rand durch den Inhalt des relativen Layouts ersetzt wird. Ich habe hochgeladen das Bild

Antwort

2

Verwendung diesen Code:

<?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="wrap_content" 
android:orientation="vertical" 
android:background="@drawable/images"> 

<com.example.acer.myapplication.ZoomView 
    android:id="@+id/iop" 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="1" 
    android:gravity="center"/> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
android:layout_alignParentBottom="true" 
> 
    <SeekBar 
     android:id="@+id/seekBar7" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" /> 
    <Button 
     android:id="@+id/button61" 
     android:layout_width="50dp" 
     android:layout_height="50dp" 
     android:layout_below="@id/seekBar7" 
     android:layout_centerInParent="true" 
     android:background="@drawable/play" /> 
</RelativeLayout> 
</RelativeLayout> 
+0

schauen, bitte kreuzen Sie meine Antwort, wenn es für Sie arbeitete ... danke. –

+0

hat es funktioniert ..... danke – Devk

+0

Bitte kreuzen Sie meine Antwort an –