褪色的android.support.v7.widget.Toolbar
我想创建一个配置文件活动,其工具栏应如下所示: 到目前为止,我有: 另外,我不知道如何摆脱这种阴影或叠加效果,也许这已经解决了我的问题 activity_activity_profile.xml褪色的android.support.v7.widget.Toolbar,android,android-toolbar,user-profile,Android,Android Toolbar,User Profile,我想创建一个配置文件活动,其工具栏应如下所示: 到目前为止,我有: 另外,我不知道如何摆脱这种阴影或叠加效果,也许这已经解决了我的问题 activity_activity_profile.xml <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/and
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.appmac.ron.app_newsfeed.ActivityProfil">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@drawable/toolbar_color"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_activity_profil" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
我现在有这个:
如果需要更多的代码,请告诉我,我会更新它。
谢谢你的帮助 在AppBarLayout
上将高程设置为0dp
:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp"
android:theme="@style/AppTheme.AppBarOverlay">
您可能还需要将背景移动到AppBarLayout
。在AppBarLayout
上将高程设置为0dp
:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp"
android:theme="@style/AppTheme.AppBarOverlay">
您可能还需要将背景移动到AppBarLayout
。非常感谢,这很有帮助!我更新了我的帖子,你对此有什么建议吗@Eugen PechanecAs我说过将背景从工具栏移动到AppBarLayout。它应该是从#4000到#0000的梯度。将内容视图(滚动视图)放在CoordinatorLayout后面,并将paddingTop设置为?actionBarSize
。不过,你最好再发一个问题。我有一个褪色的颜色效果,这很有帮助,但我想让它也透明,这样你就可以看到工具栏后面滚动的内容:/@Eugen pechanect非常感谢你,这很有帮助!我更新了我的帖子,你对此有什么建议吗@Eugen PechanecAs我说过将背景从工具栏移动到AppBarLayout。它应该是从#4000到#0000的梯度。将内容视图(滚动视图)放在CoordinatorLayout后面,并将paddingTop设置为?actionBarSize
。不过你最好再问一个问题。我有这种褪色的颜色效果,这很有帮助,但我想让它也透明,这样你就可以看到工具栏后面滚动的内容:/@Eugen Pechanec