简体   繁体   English

左上角和右上角圆形边缘

[英]Top left and top right rounded edge

I am trying to make the top left and top right round and the bottom left and bottom left square. 我试图使左上角和右上角圆形以及左下角和左下角正方形。

I have the following code: 我有以下代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
    <stroke
        android:width="0dp"
        android:color="#FFFFFF" />
    <solid android:color="#D30308" />
    <padding
        android:left="0dp"
        android:right="0dp"
        android:top="0dp" />
    <corners
        android:radius="10dp"
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp" />
</shape>

But it makes all side round: 但这使一切变得圆滑:

在此处输入图片说明

What do I have to modify in my code to accomplish it? 要完成此操作,我需要在代码中进行哪些修改?

Try to remove android:radius="10dp" to get this: 尝试删除android:radius="10dp"以获得此信息:

<corners
        android:topLeftRadius="10dp"
        android:topRightRadius="10dp" />

I think that android:radius is a parameter for all corners. 我认为android:radius是所有角落的参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM