LinearLayout中视图之间的意外空间

时间:2014-02-25 10:13:04

标签: android android-linearlayout spacing

我有以下布局:

<?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>

在我的设备上,它看起来像这样: enter image description here
如您所见,有两个“分隔符” - 一个位于应用程序窗口的顶部边框和ImageView之间,第二个位于ImageView和MapView之间。我已将paddings / margin设置为0 - 没有运气。我该怎么办呢?

2 个答案:

答案 0 :(得分:1)

尝试将其用于图片视图

<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"/>

答案 1 :(得分:0)

不确定我是否怀疑这一点。但这些分隔线是你形象的一部分。顶部和底部有一些黑色边框。尝试使用其他图像

相关问题