[英]Unexpected space between views in 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"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:id="@+id/fragment_send_imageView"
android:layout_margin="0dp"
android:padding="0dp"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:padding="0dp"
android:layout_margin="0dp">
<com.google.android.gms.maps.MapView
android:id="@+id/fragment_send_mapView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
</LinearLayout>
在我的設備上,它看起來像這樣:
如您所見,有兩個“分隔線”-一個位於應用程序窗口的頂部邊框和ImageView之間,第二個位於ImageView和MapView之間。 我已經將paddings / margins設置為0-不走運。 我該怎么辦?
嘗試此以獲取圖像視圖
<ImageView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:id="@+id/fragment_send_imageView"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:padding="0dp"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.