简体   繁体   English

Android如何绘制像这样的线性布局拐角形状

[英]Android how to draw Linear layout corners shape like this

I want to make a layout corners with shape like in this images .i goggled in net but i didn't found any code regarding curve shape, please help me ,please check the below image. 我想使布局角与该图像一样。我在网中扫了一眼,但我没有找到有关曲线形状的任何代码,请帮助我,请检查以下图像。 i want to design linear layout with curve shape. 我想设计曲线形状的线性布局。

<LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/curve"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

            <TextView
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:padding="5dp"
                android:text="Hi, This layout has rounded corner borders ..." />
        </LinearLayout>
    </LinearLayout>


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

    <!-- view background color -->
    <solid
        android:color="#a9c5ac" >
    </solid>

    <!-- view border color and width -->
    <stroke
        android:width="1dp"
        android:color="#1c1b20" >
    </stroke>

    <!-- If you want to add some padding -->
    <padding
        android:left="4dp"
        android:top="4dp"
        android:right="4dp"
        android:bottom="4dp"    >
    </padding>

    <!-- Here is the corner radius -->
    <corners
        android:radius="8dp"
         android:bottomLeftRadius="-15dp"
        android:bottomRightRadius="-15dp"
        android:topLeftRadius="-15dp"
        android:topRightRadius="-15dp"   >
    </corners>

</shape>

在此处输入图片说明

<TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/curve"
        android:gravity="center_vertical|center_horizontal"
        android:padding="5dp"
        android:text="Hi, This layout has rounded corner borders ..." />

use this curve.9.png image 使用这个curve.9.png图像

在此处输入图片说明

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

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