半圈工具栏Android

时间:2017-04-30 17:54:31

标签: android material-design android-toolbar

有人可以告诉我如何创建像toolbar这样的自定义工具栏。

如何添加该自定义工具栏?

这是我的xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/praktik"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants"
android:fitsSystemWindows="true">
<include layout="@layout/content_main_games"/>
</LinearLayout>

1 个答案:

答案 0 :(得分:0)

使用此设计设置背景。

<item>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="rectangle">
        <solid android:color="#00B0EA" />

    </shape>
</item>
<item
    android:bottom="400dp"
    android:left="-100dp"
    android:right="-100dp"
    android:top="-200dp">
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <gradient
            android:angle="90"
            android:endColor="#65FFFFFF"
            android:startColor="#65FFFFFF" />
    </shape>
</item>
<item
    android:bottom="402dp"
    android:left="-100dp"

    android:right="-100dp"
    android:top="-280dp">
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
        android:shape="oval">
        <solid android:color="#FFFFFF" />
    </shape>
</item>