java如何移动导航栏的渐变以匹配背景?
我是Android Studio的新手,在此之前我主要从事设计工作。我已经准备好导航栏,但我不知道如何将其背景与应用程序的背景匹配。我在XD中附加了我的设计,以及我在Android Studio中所做的。我想将工具栏和导航栏与背景渐变相匹配,但仍然使用它们自己的背景覆盖它们,这样片段内容就不会重叠
我的代码是:
<?xml version="1.0" encoding="utf-8"?>
<安卓x.constraintlayout.widget.ConstraintLayout xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
xmlns:app="http://schemas.安卓.com/apk/res-auto"
xmlns:tools="http://schemas.安卓.com/tools"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
安卓:background="@drawable/background_gradient"
tools:context=".MainActivity">
<FrameLayout
安卓:id="@+id/container"
安卓:layout_width="match_parent"
安卓:layout_height="match_parent"
/>
<com.google.安卓.material.bottomnavigation.BottomNavigationView
安卓:id="@+id/bottomNavigation"
安卓:layout_width="match_parent"
安卓:layout_height="0dp"
app:layout_constraintDimensionRatio="h,4.5:1"
app:layout_constraintBottom_toBottomOf="parent"
app:menu="@menu/menu_bottom"
安卓:background="@drawable/background_gradient"
app:itemBackground="@安卓:color/transparent"
app:itemIconTint="#F8F8F8"
app:itemTextColor="#F8F8F8"
app:itemIconSize="28dp">
<com.google.安卓.material.floatingactionbutton.FloatingActionButton
安卓:id="@+id/add"
安卓:layout_width="65dp"
安卓:layout_height="65dp"
安卓:layout_gravity="center"
app:rippleColor="#C8BCD0F8"
安卓:src="@drawable/ic_add_new"
app:maxImageSize="35dp"
安卓:scaleType="center"
app:fabCustomSize="65dp"
安卓:tint="@color/black"
/>
</com.google.安卓.material.bottomnavigation.BottomNavigationView>
</安卓x.constraintlayout.widget.ConstraintLayout>
共 (0) 个答案