gpt4 book ai didi

android - 没有命名空间的项目在风格上意味着什么

转载 作者:行者123 更新时间:2023-12-04 17:04:23 25 4
gpt4 key购买 nike

<style name="Widget.Styled.ActionBar" parent="Widget.Sherlock.Light.ActionBar.Solid.Inverse">
<item name="background">@drawable/bg_action_bar</item>
<item name="android:background">@drawable/bg_action_bar</item>
<item name="android:textColor">@color/my_red</item>
</style>

<style name="My_Style" parent="style/Theme.Sherlock.Light">
<item name="android:actionBarStyle">@style/ActionBar</item>
<item name="android:homeAsUpIndicator">@drawable/ic_action_back</item>
<item name="homeAsUpIndicator">@drawable/ic_action_back</item>
</style>

'homeAsUpIndicator' 和 'android:homeAsUpIndicator' 或 'background' 和 'android:background' 之间有什么区别?

我想知道我是否需要设置它们?我刚刚找到了这些示例,但是当您不使用“android”命名空间时找不到您正在设置的内容...

最佳答案

Due to limitations in Android's theming system any theme customizations must be declared in two attributes. The normal android-prefixed attributes apply the theme to the native action bar and the unprefixed attributes are for the custom implementation. Since both theming APIs are exactly the same you need only reference your customizations twice rather than having to implement them twice.



准确传达这意味着什么的最简单方法是使用示例。以下是上述“样式”示例的完整主题:
<style name="Theme.Styled" parent="Theme.Sherlock.Light.DarkActionBar">
<item name="actionBarStyle">@style/Widget.Styled.ActionBar</item>
<item name="android:actionBarStyle">@style/Widget.Styled.ActionBar</item>
</style>

阅读更多关于 ActionbarSherlock's Mirrored Attributes

关于android - 没有命名空间的项目在风格上意味着什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18081814/

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