Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android RelativeLayout:如何删除第二个布局周围的边框?_Android_Xml_Android Layout - Fatal编程技术网

Android RelativeLayout:如何删除第二个布局周围的边框?

Android RelativeLayout:如何删除第二个布局周围的边框?,android,xml,android-layout,Android,Xml,Android Layout,我有一个xml文件,其中包含两个RelativeLayouts。问题在于第二个相对值yout没有达到显示极限。它看起来像布局周围的边框 如何在显示器的边框上显示第二层 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.

我有一个
xml
文件,其中包含两个
RelativeLayout
s。问题在于第二个
相对值yout
没有达到显示极限。它看起来像布局周围的边框

如何在显示器的边框上显示第二层

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:background="@color/colorAccent"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="newservice"
tools:showIn="@layout/activity_newservice">


<RelativeLayout
    android:id="@+id/test"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorPrimaryDark"
     android:layout_alignBottom="@+id/viewmap"
    android:layout_centerHorizontal="true">
</RelativeLayout>

</RelativeLayout>

删除您的

android:paddingXXX来自家长
RelatvieLayout


这是一个问题

删除顶部布局上的这一行:

android:paddingTop="@dimen/activity_vertical_margin"
您在顶部添加了一个填充,因此第二个布局不会像您所希望的那样填充第一个布局

问候


   <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/colorAccent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="newservice"
    tools:showIn="@layout/activity_newservice">


    <RelativeLayout
        android:id="@+id/test"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/colorPrimaryDark"
         android:layout_alignBottom="@+id/viewmap"
        android:layout_centerHorizontal="true">
    </RelativeLayout>

    </RelativeLayout>
试试这个