透明的动作条不工作 [英] Transparent ActionBar is not working

查看:138
本文介绍了透明的动作条不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能够设置透明度或任何其他颜色的动作条。我style.xml:

I'm not able to set the transparency or any other color to the Actionbar. My style.xml:

<style name="thin_actionbar" parent="android:Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/thin_actionbar_style</item>

</style>
<style name="thin_actionbar_style" parent="android:Widget.Holo.ActionBar">
    <item name="android:height">60dp</item>
    <item name="android:homeAsUpIndicator">@drawable/ic_drawer</item>
    <item name="android:background">@color/translucent_control</item>
</style>

tranlucent_color:喜欢扎在下面的截图。 看起来是这样。这只是灰色的:

tranlucent_color: like the bar in the screenshot below. Looks like this. It's just grey:

请帮帮我!

推荐答案

试试这个code

<item name="android:background">@null</item>

如果这一点儿也不帮助你,请与此code此链接

If this does'nt helps you, Check this link with this Code

呼叫 setStackedBackgroundDrawable()动作条

getWindow()requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY)。 动作条动作条= getActionBar(); actionBar.setBackgroundDrawable(新ColorDrawable(Color.parseColor(#330000ff))); actionBar.setStackedBackgroundDrawable(新ColorDrawable(Color.parseColor(#550000ff)));

getWindow().requestFeature(Window.FEATURE_ACTION_BAR_OVERLAY); ActionBar actionBar = getActionBar(); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#330000ff"))); actionBar.setStackedBackgroundDrawable(new ColorDrawable(Color.parseColor("#550000ff")));

<一个href="http://stackoverflow.com/questions/13381567/show-imageview-partly-behind-transparent-actionbar">this链接,这code

OR this link , this code

&LT;样式名称=MyTheme的父=Theme.Sherlock&GT;     ...     &LT;项目名称=windowActionBarOverlay&GT;真&LT; /项目&GT; &LT;! - 为ActionBarSherlock - &GT;     &LT;项目名称=机器人:windowActionBarOverlay&GT;真&LT; /项目&GT; &LT; /风格&GT;

<style name="MyTheme" parent="Theme.Sherlock"> ... <item name="windowActionBarOverlay">true</item> <!-- for ActionBarSherlock --> <item name="android:windowActionBarOverlay">true</item> </style>

为了使动作条Transparent.Hope这会有所帮助。

For making ActionBar Transparent.Hope this helps.

这篇关于透明的动作条不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆