gpt4 book ai didi

Android 5 特性——自定义滑动时屏幕边缘的阴影

转载 作者:行者123 更新时间:2023-11-30 02:28:56 26 4
gpt4 key购买 nike

屏幕截图中屏幕底部显示的阴影的技术名称是什么?我似乎无法通过在线搜索找到它的术语。

如果任何人还没有安装 Android 5,但对它的功能有些熟悉,那么当您尝试向无处可去的方向滑动时会出现此阴影(例如,在已经到达 Android 5 的位置时向下滑动)此菜单底部)。

是否可以在我自己的应用程序中更改此阴影的颜色? - 如果是这样,怎么办?

Screenshot

最佳答案

根据 Brian 的评论,我相信一种改变边缘效果颜色的方法是通过 colorPrimarydeveloper guides描述为:

应用程序的主要品牌颜色;用作操作栏背景、最近任务标题和边缘效果。

在使用 Material 主题时更改 colorPrimary 和其他属性,发现 here .

另请参阅colorEdgeEffect:

其他属性可以对着色控件进行细粒度控制,请参阅:colorControlNormal、colorControlActivated、colorControlHighlight、colorButtonNormal、colorSwitchThumbNormal、colorEdgeEffect、statusBarColor 和 navigationBarColor。

<resources>
<!-- inherit from the material theme -->
<style name="AppTheme" parent="android:Theme.Material">
<!-- Main theme colors -->
<!-- your app branding color for the app bar -->
<!-- changing colorPrimary will change the color of the edge effect -->
<item name="android:colorPrimary">@color/primary</item>
<!-- darker variant for the status bar and contextual app bars -->
<item name="android:colorPrimaryDark">@color/primary_dark</item>
<!-- theme UI controls like checkboxes and text fields -->
<item name="android:colorAccent">@color/accent</item>
</style>
</resources>

关于Android 5 特性——自定义滑动时屏幕边缘的阴影,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27540116/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com