2016-11-25 126 views

回答

2

使用的东西作为

ResourcesCompat.getColor(getResources(), R.color.red, null) 

(以API级别23的主题之前,将不会应用,因此它可能是null。)

+0

我会建议使用'context.getTheme()'而不是'null'或者你可能只是使用不推荐的方法。 –