如何制作曲线工具栏和布局?

时间:2019-03-16 14:18:01

标签: android android-layout android-toolbar android-xml android-vectordrawable

我正在尝试做这样的事情,但我做不到,任何人都可以帮助我! enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用ArcLayout库。

  1. 向build.gradle(应用程序级别)添加依赖项

    编译'com.github.florent37:arclayout:1.0.3'

  2. 将ArcLayout添加到您的xml中,它可以在您的情况下在内部或外部创建曲线,因此请使用此app:arc_cropDirection="cropInside"属性。

    <com.github.florent37.arclayout.ArcLayout
           android:layout_width="match_parent"
           android:layout_height="200dp"
           app:arc_cropDirection="cropInside"
           app:arc_height="90dp"
           app:arc_padding="30dp"
           android:elevation="5dp"
           >
    
          <!--Your layout will be here to make toolbar -->