gpt4 book ai didi

android - Make Title Bar Transparent, Transparent ActionBar - Sample Design Included - 是否有可能有这样的 Material 设计页面

转载 作者:行者123 更新时间:2023-11-30 01:47:54 25 4
gpt4 key购买 nike

我想为我的应用程序开发一个配置文件屏幕。我正在使用 AppCompactActivity,因为我需要我的应用程序也支持非 Lollipop 设备。我只需要为应用程序中的这个特定 Activity 屏幕使标题栏透明。我还希望操作栏是透明的。

Picture - Material Design Sample Profile Page with Transparent Title and Action Bar

请看上面的示例图片,我得到了我的 MaterialDesign 网站,如果有人能给我开发这样一个页面的代码,那就太好了。非常感谢您的帮助。

最佳答案

如果您使用的是 AppCompatActivity,那么您可以直接在主/父 Activity 中执行以下操作。

int FEATURE_ACTION_BAR_OVERLAY : Flag for requesting an Action Bar that overlays window content.

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
supportRequestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
setContentView(yourview)
}

并确保您没有为操作栏设置任何背景。
使用 supportRequestWindowFeature 方便调用 getWindow().requestFeature()。

关于android - Make Title Bar Transparent, Transparent ActionBar - Sample Design Included - 是否有可能有这样的 Material 设计页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33452881/

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