所以我环顾四周,发现android.R.styleable
不再是SDK的一部分,尽管它仍然是文档中的here。
如果清楚地记录了替代方案是什么,那就不是问题了。例如,AOSP Calendar App仍在使用android.R.styleable
// 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一起工作?
https://stackoverflow.com/questions/2127177
复制相似问题