android中的曲线布局

android中的曲线布局,android,android-studio,android-layout,Android,Android Studio,Android Layout,我想知道,如何创建左侧高度大于右侧高度的曲线半径样式布局 这就是我迄今为止所尝试的: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <stroke android:width="0.5dp" android:color="@color/white" /> <corners android:bottomLe

我想知道,如何创建左侧高度大于右侧高度的曲线半径样式布局

这就是我迄今为止所尝试的:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
    android:width="0.5dp"
    android:color="@color/white" />
<corners
    android:bottomLeftRadius="150dp"
    android:bottomRightRadius="150dp"
    android:topLeftRadius="0dp"
    android:topRightRadius="0dp" />
<padding
    android:bottom="0dp"
    android:left="0dp"
    android:right="0dp"
    android:top="0dp" />

<solid android:color="@color/red/>


这里有一个这样的图书馆

这是一个快速的例子

<com.github.florent37.diagonallayout.DiagonalLayout
        android:layout_width="match_parent"
        android:layout_height="250dp"
        diagonal:diagonal_angle="10"
        diagonal:diagonal_position="left / right / top / bottom"
        diagonal:diagonal_direction="left / right"
        android:elevation="10dp">

    <!-- YOUR CONTENT -->

</com.github.florent37.diagonallayout.DiagonalLayout>


我使用矢量图像作为背景来获得这个形状

登录页面布局

    <LinearLayout
    android:id="@+id/headerLayout"
    android:layout_width="match_parent"
    android:layout_height="@dimen/diagonal_rect_size_pos"
    android:background="@drawable/background"
    android:orientation="vertical"
    >


    <ImageView
        android:id="@+id/sixitLogoImageView"
        android:layout_width="@dimen/sixit_logo_size"
        android:layout_height="@dimen/sixit_logo_size"
        android:layout_gravity="center"
        android:src="@drawable/sixit_logo_white"
        android:layout_margin="@dimen/default_padding"
        />

</LinearLayout>

background.xml

   <vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="360.002dp"
    android:height="280.806dp"
    android:viewportWidth="360.002"
    android:viewportHeight="280.806">
  <path
      android:pathData="M0.002,0h359.969v179.557a18.379,18.379 0,0 1,-11.213 17.919c-4.179,4.213 -336.377,82.7 -339.615,82.745s-9.274,4.732 -9.142,-13.251c0.133,0.001 0.001,-266.97 0.001,-266.97z"
      android:fillColor="#161616"/>
</vector>


那可能只是一个图像我想知道如何使用shape drawable实现这一点你不会使用shape drawable,shape是非常有限的。您可以使用图像或矢量绘图。可以在拐角处添加半径。如果要修改库文件,可以使用库文件。它是开源的。