免冠照换背景色 android getcolor theme怎么设置?
android getcolor theme怎么设置?中的每个应用程序和清单.xml在Theme中设置主题,定义APK的一些主题属性(即整个环境的属性,如APK的背景色、对话框的样式等)。在应用程序中
android getcolor theme怎么设置?
中的每个应用程序和清单.xml在Theme中设置主题,定义APK的一些主题属性(即整个环境的属性,如APK的背景色、对话框的样式等)。
在应用程序中,有时会更改控件或视图的背景色,然后通过触发器事件返回主题的背景色。您需要获得主题的背景色属性。
可通过以下方法获得:
typedarray=gettheme()。获取StyledAttributes(New Int[]Android。右属性颜色背景,
安卓.R。属性textColorPrimary,
})
int backgroundColor=数组.getColor(0,0xFF00FF)
int textColor=数组.getColor(1,0xFF00FF)数组.回收()