2016-05-26 5 views
0

Es gibt eine Lücke zwischen zwei relativen Layouts. Ich möchte diese Lücke beseitigen.Es gibt eine Lücke zwischen zwei relativen Layouts

this is the image of the above xml

Mein xml des Bildes wird unter

<RelativeLayout 
    android:id="@+id/live_view_surface_view_rl" 
    android:layout_width="fill_parent" 
    android:layout_height="@dimen/video_height"> 

    <RelativeLayout 
     android:id="@+id/surfaceview_rl" 
     android:layout_width="match_parent" 
     android:layout_height="fill_parent" 
     android:layout_above="@+id/palette_rl"> 

     <SurfaceView 
      android:id="@+id/surfaceview" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_alignParentTop="true" 
      android:layout_centerInParent="true"> 
     </SurfaceView>   
    </RelativeLayout> 

    <RelativeLayout 
     android:id="@+id/palette_rl" 
     android:layout_width="fill_parent" 
     android:layout_height="60dp" 
     android:layout_alignParentBottom="true" 
     android:background="@color/transperent_black_color"> 

     <RelativeLayout 
      android:id="@+id/snapshot_button_rl" 
      android:layout_width="50dp" 
      android:layout_height="fill_parent" 
      android:layout_marginLeft="@dimen/margin_left_right"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:src="@drawable/snapshotselection" /> 
     </RelativeLayout> 

     <LinearLayout 
      android:id="@+id/mic_btn_rl_parent" 
      android:layout_width="100dp" 
      android:layout_height="fill_parent" 
      android:layout_toRightOf="@+id/snapshot_button_rl" 
      android:orientation="horizontal"> 

      <RelativeLayout 
       android:id="@+id/mic_button_rl" 
       android:layout_width="50dp" 
       android:layout_height="fill_parent"> 

       <ImageView 
        android:id="@+id/mic_button" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:src="@drawable/talkbackbtn_selector" /> 

       <ProgressBar 
        android:id="@+id/start_talkback_progress" 
        android:layout_width="@dimen/field_width_small" 
        android:layout_height="@dimen/field_width_small" 
        android:layout_centerInParent="true" 
        android:visibility="gone" /> 
      </RelativeLayout> 

      <RelativeLayout 
       android:id="@+id/live_view_audio_icon_rl" 
       android:layout_width="@dimen/field_width_medium" 
       android:layout_height="fill_parent"> 

       <ImageView 
        android:id="@+id/live_view_audio_icon" 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:layout_centerInParent="true" 
        android:src="@drawable/icon_volume" /> 
      </RelativeLayout> 
     </LinearLayout> 
    </RelativeLayout> 
</RelativeLayout> 

gegeben Diese Lücke bleibt gleich, auch erhöhe ich die Höhe der unten relativ Layout. Beide Layouts haben die gleichen Eltern, aber sie sind immer noch nicht in der gleichen angepasst.

+3

Ihre xml hinterlassen bitte – Nisarg

+1

@Nisarg das ist mein xml – UserSharma

+0

jetzt gut mir lassen –

Antwort

0

Hallo Gerade Copy Paste und schreiben Sie Ihre xml innerhalb Relative Layout-

<LinearLayout  xmlns:android="http://schemas.android.com/apk/res/android" 
android:orientation="vertical" android:layout_width="match_parent" 
android:layout_height="match_parent"> 

<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="8"> 

</RelativeLayout> 
<RelativeLayout 
    android:layout_width="match_parent" 
    android:layout_height="0dp" 
    android:layout_weight="2"> 

</RelativeLayout> 

+0

Ich versuchte es, aber meine Frage bleibt gleiche – UserSharma

+0

mit match_parent und palette_rl Layout Ihres Video Höhe ersetzt auch eine match_parent –

+0

ich versuchte es auch, aber immer noch keine Änderungen – UserSharma

0

Satz weightsum = 1 bis Eltern-Layout (palette_rl) Gewicht .after gesetzt = 0,25 für alle Kind Relative Layout und halten es ist layout_width = 0dip.it funktioniert einwandfrei. Stellen Sie den gesamten Platz in der gleichen Reihenfolge ein.

Verwenden Sie bitte unter Xml.Ich änderte Höhe und Dimension und zeichnerisch. also, bitte passen Sie es an. Es funktioniert gut. Schwarze Linie entfernt.

<?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" 
    tools:context=".MainActivity" > 
<RelativeLayout 
android:id="@+id/live_view_surface_view_rl" 
android:layout_width="fill_parent" 
android:layout_height="match_parent"> 

<RelativeLayout 
    android:id="@+id/surfaceview_rl" 
    android:layout_width="match_parent" 
    android:layout_height="fill_parent" 
    > 

    <SurfaceView 
     android:id="@+id/surfaceview" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:layout_alignParentTop="true" 
     android:layout_centerInParent="true"> 
    </SurfaceView>   
</RelativeLayout> 

<RelativeLayout 
    android:id="@+id/palette_rl" 
    android:layout_width="fill_parent" 
    android:layout_height="60dp" 
    android:layout_alignParentBottom="true" 
    android:background="#ab00aa"> 

    <RelativeLayout 
     android:id="@+id/snapshot_button_rl" 
     android:layout_width="50dp" 
     android:layout_height="fill_parent" 
     android:layout_marginLeft="10dp"> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_centerInParent="true" 
      android:src="@drawable/ic_launcher" /> 
    </RelativeLayout> 

    <LinearLayout 
     android:id="@+id/mic_btn_rl_parent" 
     android:layout_width="100dp" 
     android:layout_height="fill_parent" 
     android:layout_toRightOf="@+id/snapshot_button_rl" 
     android:orientation="horizontal"> 

     <RelativeLayout 
      android:id="@+id/mic_button_rl" 
      android:layout_width="50dp" 
      android:layout_height="fill_parent"> 

      <ImageView 
       android:id="@+id/mic_button" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:src="@drawable/ic_launcher" /> 

      <ProgressBar 
       android:id="@+id/start_talkback_progress" 
       android:layout_width="50dp" 
       android:layout_height="50dp" 
       android:layout_centerInParent="true" 
       android:visibility="gone" /> 
     </RelativeLayout> 

     <RelativeLayout 
      android:id="@+id/live_view_audio_icon_rl" 
      android:layout_width="50dp" 
      android:layout_height="fill_parent"> 

      <ImageView 
       android:id="@+id/live_view_audio_icon" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:src="@drawable/ic_launcher" /> 
     </RelativeLayout> 
    </LinearLayout> 
</RelativeLayout> 

+0

ich habe ein Problem in Höhen der Layouts der schwarze Streifen zwischen zwei Layouts ist in ihrer Höhe – UserSharma

+0

Ich habe XML-Datei in Antwort hinzugefügt. – Vasant