gpt4 book ai didi

android - 查找由 android 平台主题定义的所有可用样式

转载 作者:IT王子 更新时间:2023-10-28 23:52:16 24 4
gpt4 key购买 nike

在几个 android 样式教程中使用了我在 android.R.style.* 样式 (http://developer.android.com/reference/android/R.style.html) 中找不到的父样式元素。

一些示例来自 http://android-developers.blogspot.com/2011/04/customizing-action-bar.html操作栏文章。 Nick 使用如下父样式:

<style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar">
...
</style>

<style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBarView_TabView">
...
</style>

这些父样式从何而来?是否可以列出所有可用的父样式?

谢谢。

最佳答案

"Applying Styles and Themes" 中所述文章:

The Android platform provides a large collection of styles and themes that you can use in your applications. You can find a reference of all available styles in the R.style class. To use the styles listed here, replace all underscores in the style name with a period. For example, you can apply the Theme_NoTitleBar theme with "@android:style/Theme.NoTitleBar".

The R.style reference, however, is not well documented and does not thoroughly describe the styles, so viewing the actual source code for these styles and themes will give you a better understanding of what style properties each one provides. For a better reference to the Android styles and themes, see the following source code:

These files will help you learn through example. For instance, in the Android themes source code, you'll find a declaration for <style
name="Theme.Dialog">
. In this definition, you'll see all of the properties that are used to style dialogs that are used by the Android framework.

关于android - 查找由 android 平台主题定义的所有可用样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6562272/

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