首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何使用带有Android内部主题的obtainStyledAttributes(int [])

如何使用带有Android内部主题的obtainStyledAttributes(int [])
EN

Stack Overflow用户
提问于 2010-01-24 21:21:16
回答 4查看 43.1K关注 0票数 21

所以我环顾四周,发现android.R.styleable不再是SDK的一部分,尽管它仍然是文档中的here

如果清楚地记录了替代方案是什么,那就不是问题了。例如,AOSP Calendar App仍在使用android.R.styleable

代码语言:javascript
复制
// Get the dim amount from the theme   
TypedArray a = obtainStyledAttributes(com.android.internal.R.styleable.Theme);
lp.dimAmount = a.getFloat(android.R.styleable.Theme_backgroundDimAmount, 0.5f);
a.recycle();

那么,如果不从android.R.styleable.Theme获取int[],如何获得backgroundDimAmount呢?

我需要在obtainStyledAttributes(int [])中做些什么才能让它与SDK一起工作?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2127177

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档