【问题标题】:Transparent Status Bar Android 4.3透明状态栏 Android 4.3
【发布时间】:2014-01-06 19:50:30
【问题描述】:

在“新”Android 版本 4.3 中有一项新功能。屏幕顶部的状态栏在启动器(我在 Galaxy S3 上使用三星 TouchWiz)和其他一些应用程序中也是透明的(看起来有点像 iOS 7 风格)。 你能告诉我如何在我自己的应用程序(Eclipse、Java)中使状态栏透明(或彩色)吗?

【问题讨论】:

    标签: java android eclipse transparency statusbar


    【解决方案1】:
    Theme.Holo.NoActionBar.TranslucentDecor 
    
    Theme.Holo.Light.NoActionBar.TranslucentDecor
    

    根据此处的最佳答案:How to make the navigation bar transparent

    【讨论】:

      【解决方案2】:

      我不确定透明度,但从 API 10 开始,您可以为 actionBar 设置背景可绘制对象。 (因此是一种颜色) 在以下代码n-p中,我根据属性(取决于选择的主题)获得颜色

      TypedArray a = getTheme().obtainStyledAttributes(new int[]{R.attr.background_activity_color});
      actionBar.setBackgroundDrawable(a.getDrawable(0));
      

      【讨论】:

      • 谢谢,但这不是我要找的。我说的是状态栏,而不是动作栏。你可以在这张图片上看到它:fs01.androidpit.info/userfiles/2732026/image/…
      • 哦,那我很抱歉。 :) 我建议您编辑最后一句,因为您在那里使用了“操作栏”。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      • 1970-01-01
      • 1970-01-01
      • 2015-07-06
      • 2017-07-07
      相关资源
      最近更新 更多