添加动作条上的阴影 [英] Add a shadow on ActionBar

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

问题描述

我想在动作条的标题添加阴影。我试图把属性

I am trying to add a shadow under the title of the ActionBar. I have tried putting the attributes

    <item name="android:textColor">@color/white</item>
    <item name="android:shadowRadius">1</item>
    <item name="android:shadowColor">@color/black</item>
    <item name="android:shadowDy">1</item>

不过,虽然文字颜色正,影子是没有的。我使用ActionBarSherlock 3.5,但我认为它不会在本地工作的。

but while textColor is working, the shadow isn't. I am using ActionBarSherlock 3.5 but I think it would not work on native either.

感谢

推荐答案

我不能得到这个工作,无论是在本地或ABS反向移植。使用这里提到的方法 的伟大工程。对于安卓customNavigationLayout 布局你可以柔顺单一的TextView与你的风格应用。这样做了在你的活动/活动基地编程设置标题的缺点。这可以通过从 Activity.getTitle抓住值(做),这是操作栏确实,如果标题设置什么。没有足够的时间寻找到更多!

I can't get this to work either on native or ABS backport. Using the approach mentioned here works great. For the android:customNavigationLayout layout you can just supple a single textView with your style applied. This has the drawback of having to set the title programatically in your activity / base activity. This can be done by grabbing the value from Activity.getTitle(), which is what the action bar does if a title is set. Not enough time to look into further!

PS嗨克里斯!

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

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