变化ActionbarSherlock homeAsUpIndicator图标不会在ICS效果呢? [英] Change of homeAsUpIndicator icon in ActionbarSherlock does not effect in ICS?

查看:231
本文介绍了变化ActionbarSherlock homeAsUpIndicator图标不会在ICS效果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图改变在动作条 homeAsUpIndicator 图标。我用 ActionBarSherlock 是与旧的Andr​​oid版本兼容。我设置一个特定的主题,我的活动,当应用程序运行的设备与ICS和ICS旧verions它显示不同颜色。

这是我使用的样式

 <样式名称=Theme.PM父=@风格/ Theme.Sherlock.Light>

    <项目名称=机器人:homeAsUpIndicator> @可绘制/ back_sign< /项目>
    <项目名称=homeAsUpIndicator> @可绘制/ back_sign< /项目>

< /风格>
 

这样下面的图像的 对于ICS看到回家了指标看起来像黑色。

对于旧版本的ICS看到回家了指标看起来像白色。

我使用同样的图像两个版本,但它看起来对ICS的不同。如何解决这个问题。

解决方案

 < XML版本=1.0编码=UTF-8&GT?;
<资源的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android>

    <样式名称=CustomStyleUpAsHome父=Theme.Sherlock.Light>
        <项目名称=机器人:actionBarStyle> @风格/ CustomActionBarUpAsHome< /项目>
        <项目名称=机器人:homeAsUpIndicator> @可绘制/ arrow_home< /项目>
        <项目名称=homeAsUpIndicator> @可绘制/ arrow_home< /项目>
    < /风格>

    <样式名称=CustomActionBarUpAsHome父=CustomActionBar>
        <项目名称=机器人:displayOptions> homeAsUp | useLogo | showHome< /项目>
        <项目名称=displayOptions> homeAsUp | useLogo | showHome< /项目>
    < /风格>

< /资源>

<活动
    机器人:名称=。activity.Activity
    机器人:screenOrientation =画像
    机器人:主题=@风格/ CustomStyleUpAsHome>
< /活性GT;
 

这code的伟大工程。尝试做这样的事情。可能它会帮助你。

祝你好运!

I try to change the homeAsUpIndicator icon in the ActionBar. I use ActionBarSherlock to be compatible with older Android Versions. I set a specific theme to my Activity when the App runs on a device with Older verions of ICS and ICS it shows different colors.

This is the style i am using

<style name="Theme.PM" parent="@style/Theme.Sherlock.Light">

    <item name="android:homeAsUpIndicator">@drawable/back_sign</item> 
    <item name="homeAsUpIndicator">@drawable/back_sign</item>

</style>

like this below image's For ICS see that home as up indicator look like black color.

For Older versions of ICS see that home as up indicator look like white color.

i am using same image for both versions, but it's looking different on ICS. how to solve this problem..

解决方案

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">

    <style name="CustomStyleUpAsHome" parent="Theme.Sherlock.Light">
        <item name="android:actionBarStyle">@style/CustomActionBarUpAsHome</item>
        <item name="android:homeAsUpIndicator">@drawable/arrow_home</item>
        <item name="homeAsUpIndicator">@drawable/arrow_home</item>
    </style>

    <style name="CustomActionBarUpAsHome" parent="CustomActionBar">
        <item name="android:displayOptions">homeAsUp|useLogo|showHome</item>
        <item name="displayOptions">homeAsUp|useLogo|showHome</item>
    </style>

</resources>

<activity
    android:name=".activity.Activity"
    android:screenOrientation="portrait"
    android:theme="@style/CustomStyleUpAsHome">
</activity>

This code works great. Try to do something like that. May be it will help you.

Good luck!

这篇关于变化ActionbarSherlock homeAsUpIndicator图标不会在ICS效果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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