为什么setProgressBackgroundColor无法解析错误? [英] why setProgressBackgroundColor can not resolve error?

查看:184
本文介绍了为什么setProgressBackgroundColor无法解析错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这个例子中

SwipeRefreshLayout swipeLayout;
swipeLayout.setProgressBackgroundColor(android.R.color.holo_blue_bright);

但在Android Studio中我得到这个错误:结果
不能解析法'setProgressBackgroundColor(INT)

but in android studio I get this error :
Can not Resolve method 'setProgressBackgroundColor(int )'

但在Android的文档,这是一个公共方法!结果
为什么我得到这个错误?!

but in android doc this is a public method!!
why I get this error?!

推荐答案

确保(在写作的时候V21)使用最新的支持库版本。例如。在gradle这个:

Be sure to use latest support lib version (v21 at the time of writing). E.g. in gradle:

compile 'com.android.support:support-v4:21.0.0'

这篇关于为什么setProgressBackgroundColor无法解析错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆