相对布局中的圆角

时间:2018-07-11 19:25:07

标签: android rounded-corners

我要在布局中添加圆角。

我为此指定了corners属性来制作形状,但是运行时,顶部的角落不会改变。 botton的就是。

那为什么顶角没有变化?

自定义标题红色

<?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <solid android:color="#EBEBEB"/>
            <corners
            android:topLeftRadius="15dp"
            android:topRightRadius="15dp"
            android:bottomRightRadius="15dp"
            android:bottomLeftRadius="15dp"
            />

    </shape>

自定义布局Saldos

 <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android">
        <solid android:color="#FFFFFF"/>

        <corners
            android:topLeftRadius="15dp"
            android:topRightRadius="15dp"
            android:bottomRightRadius="15dp"
            android:bottomLeftRadius="15dp"
            />

    </shape>

在这里使用Framelayout xml:

    <?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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=".fragment.AllAccountsFragment">


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#F1F1F1"
        android:fitsSystemWindows="true"
        android:orientation="vertical">

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="310dp"
        android:layout_height="90dp"
        android:layout_marginTop="70dp"
        android:layout_marginLeft="30dp"
        android:orientation="vertical"
        android:background="@drawable/custom_layout_saldos"
        >

        <RelativeLayout
            android:id="@+id/headerTotal"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="@drawable/custom_header_red">

            <ImageView
                android:layout_width="15dp"
                android:layout_height="15dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="90dp"
                android:background="@drawable/coins"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:text="SALDO TOTAL"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgTotalPesos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="30dp"
            android:layout_marginLeft="40dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTotalPesos"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="30dp"
            android:layout_marginLeft="80dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imgTotalPesos"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="57dp"
            android:layout_marginRight="57dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgTotalDolares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="60dp"
            android:layout_marginLeft="40dp"
            android:background="@drawable/usa_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTotalDolares"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="60dp"
            android:layout_marginLeft="80dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imgTotalDolares"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="57dp"
            android:layout_marginRight="57dp"
            android:text="USD"
            android:textSize="8dp" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="310dp"
        android:layout_height="70dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="170dp"
        android:background="#FFFFFF"
        >

        <RelativeLayout
            android:id="@+id/headerCheques"
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="70dp"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Cuentas de Cheques"
                android:textColor="#FFFFFF" />


        </RelativeLayout>

        <ImageView
            android:id="@+id/imgChequesPesos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="120dp"
            android:layout_marginTop="10dp"
            android:background="@drawable/mex_bw" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtChequesPesos"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="150dp"
            android:layout_marginTop="10dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="260dp"
            android:layout_marginTop="13dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgChequesDolares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="120dp"
            android:layout_marginTop="40dp"
            android:background="@drawable/usa_bw" />

        <ImageView
            android:id="@+id/imgChequesArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="11dp"
            android:layout_marginRight="11dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtChequesDolares"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="150dp"
            android:layout_marginTop="40dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="260dp"
            android:layout_marginTop="43dp"
            android:text="USD"
            android:textSize="8dp" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="250dp"
        android:layout_marginLeft="30dp"
        >

    <RelativeLayout
        android:id="@+id/headerCredilinea"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:background="#EBEBEB">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_centerVertical="true"
            android:textColor="#FFFFFF"
            android:text="Credilinea"/>
    </RelativeLayout>

        <ImageView
            android:id="@+id/imgCredilinea"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtCredilinea"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgCredilineaArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="250dp"
        android:layout_marginLeft="190dp"
        >

        <RelativeLayout
            android:id="@+id/headerCreditos"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:text="Tarjetas de crédito"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgCreditos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtCreditos"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgCreditosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="340dp"
        android:layout_marginLeft="30dp"
        >

        <RelativeLayout
            android:id="@+id/headerTPV"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:textSize="12dp"
                android:text="Terminal Punto de Venta"/>
        </RelativeLayout>

        <ImageView
            android:id="@+id/imgTPV"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTPV"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgTPVArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="340dp"
        android:layout_marginLeft="190dp">

        <RelativeLayout
            android:id="@+id/headerFondos"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:text="Fondos de Inversión"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgFondos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtFondos"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgFondosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="430dp"
        android:layout_marginLeft="30dp">

        <RelativeLayout
            android:id="@+id/headerPagares"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:text="Pagarés"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgPagares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtPagares"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgPagaresArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:background="#FFFFFF"
        android:layout_marginTop="430dp"
        android:layout_marginLeft="190dp">

        <RelativeLayout
            android:id="@+id/headerSeguros"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:textColor="#FFFFFF"
                android:text="Seguros de Auto"/>

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgSeguros"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="40dp"
            android:layout_marginLeft="10dp"
            android:background="@drawable/mex_bw"/>

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtSeguros"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="38dp"
            android:layout_marginLeft="30dp"
            android:textSize="13dp"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="43dp"
            android:layout_marginLeft="110dp"
            android:textSize="8dp"
            android:text="MN"/>

        <ImageView
            android:id="@+id/imgSegurosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginTop="41dp"
            android:layout_marginLeft="130dp"
            android:visibility="invisible"
            android:background="@drawable/arrow_gray" />

    </RelativeLayout>


</FrameLayout>

这是手机输出的图像

enter image description here

2 个答案:

答案 0 :(得分:1)

对于API 21或更高版本

使用Clip Views

它说,

  

通过剪切视图,您可以轻松更改视图的形状。您可以裁剪视图以与其他设计元素保持一致,或者根据用户输入更改视图的形状。您可以使用View.setClipToOutline()方法或android:clipToOutline属性将视图裁剪到其轮廓区域。 由Outline.canClip()方法确定,只有矩形,圆形和圆形矩形轮廓支持剪切

要将视图裁剪为可绘制对象的形状,请将可绘制对象设置为视图的背景(如下所示),然后调用View.setClipToOutline()方法。

剪切视图是一项昂贵的操作,因此请不要为剪切视图使用的动画效果。要实现此效果,请使用Reveal Effect动画。

<!-- res/drawable/myrect.xml -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <solid android:color="#42000000" />
    <corners android:radius="5dp" />
</shape>

答案 1 :(得分:1)

更新(基于新的共享xml)

基本上,我用drawable替换了您使用过的"@mipmap/ic_launcher"图像,并且可以看到一切正常。没有进行任何更改。在Nexus 5(api 23设备)和Pixel 2(Api 23)AVD中进行了测试。

enter image description here

    <?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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=".fragment.AllAccountsFragment">


    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#F1F1F1"
        android:fitsSystemWindows="true"
        android:orientation="vertical">

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="310dp"
        android:layout_height="90dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="70dp"
        android:background="@drawable/custom_layout_saldos"
        android:orientation="vertical">

        <RelativeLayout
            android:id="@+id/headerTotal"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="@drawable/custom_header_red">

            <ImageView
                android:layout_width="15dp"
                android:layout_height="15dp"
                android:layout_centerVertical="true"
                android:layout_marginLeft="90dp"
                android:background="@mipmap/ic_launcher" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="SALDO TOTAL"
                android:textColor="#FFFFFF" />

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgTotalPesos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="40dp"
            android:layout_marginTop="30dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTotalPesos"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="80dp"
            android:layout_marginTop="30dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imgTotalPesos"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="57dp"
            android:layout_marginRight="57dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgTotalDolares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="40dp"
            android:layout_marginTop="60dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTotalDolares"
            android:layout_width="150dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="80dp"
            android:layout_marginTop="60dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignBottom="@+id/imgTotalDolares"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_marginEnd="57dp"
            android:layout_marginRight="57dp"
            android:text="USD"
            android:textSize="8dp" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="310dp"
        android:layout_height="70dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="170dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerCheques"
            android:layout_width="100dp"
            android:layout_height="match_parent"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="70dp"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Cuentas de Cheques"
                android:textColor="#FFFFFF" />


        </RelativeLayout>

        <ImageView
            android:id="@+id/imgChequesPesos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="120dp"
            android:layout_marginTop="10dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtChequesPesos"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="150dp"
            android:layout_marginTop="10dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="260dp"
            android:layout_marginTop="13dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgChequesDolares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="120dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <ImageView
            android:id="@+id/imgChequesArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_alignParentEnd="true"
            android:layout_alignParentRight="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="11dp"
            android:layout_marginRight="11dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtChequesDolares"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="150dp"
            android:layout_marginTop="40dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="260dp"
            android:layout_marginTop="43dp"
            android:text="USD"
            android:textSize="8dp" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="250dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerCredilinea"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Credilinea"
                android:textColor="#FFFFFF" />
        </RelativeLayout>

        <ImageView
            android:id="@+id/imgCredilinea"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtCredilinea"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgCredilineaArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="190dp"
        android:layout_marginTop="250dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerCreditos"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Tarjetas de crédito"
                android:textColor="#FFFFFF" />

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgCreditos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtCreditos"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgCreditosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="340dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerTPV"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Terminal Punto de Venta"
                android:textColor="#FFFFFF"
                android:textSize="12dp" />
        </RelativeLayout>

        <ImageView
            android:id="@+id/imgTPV"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtTPV"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgTPVArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="190dp"
        android:layout_marginTop="340dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerFondos"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Fondos de Inversión"
                android:textColor="#FFFFFF" />

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgFondos"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtFondos"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgFondosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="30dp"
        android:layout_marginTop="430dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerPagares"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Pagarés"
                android:textColor="#FFFFFF" />

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgPagares"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtPagares"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgPagaresArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

    <RelativeLayout
        android:layout_width="150dp"
        android:layout_height="80dp"
        android:layout_marginLeft="190dp"
        android:layout_marginTop="430dp"
        android:background="#FFFFFF">

        <RelativeLayout
            android:id="@+id/headerSeguros"
            android:layout_width="match_parent"
            android:layout_height="20dp"
            android:background="#EBEBEB">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerVertical="true"
                android:text="Seguros de Auto"
                android:textColor="#FFFFFF" />

        </RelativeLayout>

        <ImageView
            android:id="@+id/imgSeguros"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="40dp"
            android:background="@mipmap/ic_launcher" />

        <com.elyeproj.loaderviewlibrary.LoaderTextView
            android:id="@+id/txtSeguros"
            android:layout_width="80dp"
            android:layout_height="wrap_content"
            android:layout_marginLeft="30dp"
            android:layout_marginTop="38dp"
            android:textSize="13dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="110dp"
            android:layout_marginTop="43dp"
            android:text="MN"
            android:textSize="8dp" />

        <ImageView
            android:id="@+id/imgSegurosArrow"
            android:layout_width="15dp"
            android:layout_height="15dp"
            android:layout_marginLeft="130dp"
            android:layout_marginTop="41dp"
            android:background="@mipmap/ic_launcher"
            android:visibility="invisible" />

    </RelativeLayout>

</FrameLayout>

原始(基于OP最初共享的布局xml)

每个角的半径为15dp,但您的headerTotal布局位于顶部,因此隐藏了顶部的角。可能在容器布局上有一些填充,或者headerTotal上的边距会有所帮助。但是同样要取决于您的设计目标您要实现的目标。

相关问题