复制颜色RatingBar

时间:2018-01-18 10:05:45

标签: android ratingbar

我试图在Android上创建评分栏,但是当我启动我的应用时,我底层的颜色是"复制" (见图)。如何解决这个问题?

enter image description here

MainActivity.class

Error: <spyOn> : could not find an object to spy upon for unsubscribe()
Usage: spyOn(<object>, <methodName>)

带有RatingBar的xml

        RatingBar ratingBar = (RatingBar) findViewById(R.id.rating_bar);
        ratingBar.setEnabled(false);
        ratingBar.setRating(4);

1 个答案:

答案 0 :(得分:1)

从你的代码中删除这一行:

ratingBar.setEnabled(false);