2015-08-21 27 views
-1

我的內部線性佈局(帶有藍色背景)似乎有一些空白底部的空白區域,不知道如何去除這個。 外部線性佈局也沒有填充或利潤率,從那裏這種空白來到我的內部linearLayout在底部有一些邊距

[![<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
     android:orientation="vertical" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:background="#fff"> 

     <RelativeLayout 
      android:layout_width="match_parent" 
      android:layout_height="60dp" 
      android:background="#E78F23"> 

      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="match_parent" 
       android:layout_centerVertical="true" 
       android:clickable="true" 
       android:paddingLeft="10dp" 
       android:paddingRight="10dp" 
       android:onClick="dashboard" 
       android:src="@drawable/menu"/> 

      <TextView 
       android:id="@+id/ticket_reciever_header_text" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_centerInParent="true" 
       android:textSize="25sp" 
       android:textColor="#ffffff" 
       android:text="Mike Smith"/> 

      <RelativeLayout 
       android:layout_width="match_parent" 
       android:layout_height="1dp" 
       android:background="#20000000" 
       android:layout_alignParentBottom="true"> 

      </RelativeLayout> 

     </RelativeLayout> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:orientation="horizontal" 
      android:weightSum="2"> 
      <TextView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 

       android:text="35%0FF" 
       android:gravity="center_vertical" 
       android:layout_marginTop="55dp" 
       android:layout_marginLeft="40dp" 
       android:layout_marginRight="35dp" 
       android:textSize="40sp" 
       android:textColor="@color/background_material_dark" 
       /> 
      <ImageView 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_weight="1" 
       android:layout_marginTop="10dp" 
       android:layout_marginRight="10dp" 
       android:src="@drawable/layer"/> 
     </LinearLayout> 

     <LinearLayout 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_marginTop="30dp" 
      android:orientation="horizontal" 
      android:background="#91A4AB" 
      android:weightSum="3"> 
       <RelativeLayout 
        android:layout_width="0dp" 
        android:layout_weight="3" 
        android:layout_height="55dp"> 
          <TextView 
           android:id="@+id/product_name" 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_alignParentLeft="true" 
           android:layout_alignParentTop="true" 
           android:text="AMG 020 ladies shirt" 
           android:layout_marginTop="6dp" 
           android:layout_marginLeft="12dp" 
           android:textSize="20sp" 
           /> 
           <TextView 
           android:layout_width="wrap_content" 
           android:layout_height="wrap_content" 
           android:layout_below="@id/product_name" 
           android:text="Purple heather" 
           android:layout_marginLeft="12dp" 

           android:textSize="12sp" 
           /> 
          <ImageView 
           android:layout_width="wrap_content" 
           android:layout_height="match_parent" 
           android:layout_centerVertical="true" 
           android:clickable="true" 
           android:paddingLeft="10dp" 
           android:paddingRight="10dp" 
           android:layout_alignParentRight="true" 
           android:src="@drawable/share_upper"/> 

       </RelativeLayout> 


     </LinearLayout> 

     <ImageView 
         android:layout_width="wrap_content" 
         android:layout_height="wrap_content" 
         android:src="@drawable/qr_code" 
         android:layout_marginTop="30dp" 

         android:layout_gravity="center" 
         /> 

     <LinearLayout 
         android:layout_width="fill_parent" 
         android:layout_height="50dp" 

         android:layout_gravity="center" 

         android:background="#3E41B2" 

         > 
         <ImageButton 
          android:id="@+id/shedule" 
          android:layout_width="0dp" 
          android:layout_height="match_parent" 
          android:src="@drawable/tecket_recieved_shedule" 
          android:layout_weight="1" 
          android:background="#00000000"/> 
         <ImageButton 
          android:id="@+id/location" 
          android:layout_width="0dp" 
          android:layout_height="match_parent" 
          android:layout_weight="1" 
          android:src="@drawable/ticket_received_location" 
          android:background="#00000000"/> 
         <ImageButton 
          android:id="@+id/favourite" 
          android:layout_width="0dp" 
          android:layout_height="match_parent" 
          android:src="@drawable/favourite" 
          android:layout_weight="1" 

          android:background="#00000000"/> 
         <ImageButton 
          android:layout_width="0dp" 
          android:layout_height="match_parent" 
          android:src="@drawable/share" 
          android:layout_weight="1" 
          android:background="#00000000"/> 

        </LinearLayout> 



    </LinearLayout>] 

1] 1

+3

在最後一次線性佈局中將android:layout_height =「50dp」更改爲android:layout_height =「匹配 _parent」 – Rajesh

回答

0

嘗試

android:layout_height="match_parent" 

,而不是

android:layout_height="50dp" 

在最後一個LinearLayout。

希望這有助於!

1

只需更新您的最後一次線性佈局高度。設置match_parent而不是Hard-Coded 50dp

<LinearLayout 
        android:layout_width="fill_parent" 
        android:layout_height="match_parent" 
        android:layout_gravity="center" 
        android:background="#3E41B2" 

        > 
        <ImageButton 
         android:id="@+id/shedule" 
         android:layout_width="0dp" 
         android:layout_height="match_parent" 
         android:src="@drawable/tecket_recieved_shedule" 
         android:layout_weight="1" 
         android:background="#00000000"/> 
        <ImageButton 
         android:id="@+id/location" 
         android:layout_width="0dp" 
         android:layout_height="match_parent" 
         android:layout_weight="1" 
         android:src="@drawable/ticket_received_location" 
         android:background="#00000000"/> 
        <ImageButton 
         android:id="@+id/favourite" 
         android:layout_width="0dp" 
         android:layout_height="match_parent" 
         android:src="@drawable/favourite" 
         android:layout_weight="1" 

         android:background="#00000000"/> 
        <ImageButton 
         android:layout_width="0dp" 
         android:layout_height="match_parent" 
         android:src="@drawable/share" 
         android:layout_weight="1" 
         android:background="#00000000"/> 

       </LinearLayout> 
0

您已將佈局的高度設置爲固定值(50dp)。所以它需要所有可用空間改變

android:layout_height="50dp" 

android:layout_height="match_parent" 

對於這樣您可以在開發人員選項啓用「顯示佈局界限」未來的UI問題改變它。它會在屏幕上顯示每個視圖的大小