6

是否可以将SwipeRefreshLayout中的默认进度可绘制对象更改为自定义可绘制对象?

如果是,我会丢失旋转/动画或其他属性吗?

所说的可绘制

4

1 回答 1

3
mSwipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.your_swiperefresh_id);
try {
    Field f = mSwipeRefreshLayout.getClass().getDeclaredField("mCircleView");
    f.setAccessible(true);
    ImageView img = (ImageView)f.get(mSwipeRefreshLayout);
    img.setImageResource(R.drawable.your_drawable_file);
} catch (NoSuchFieldException e) {
    e.printStackTrace();
} catch (IllegalAccessException e) {
    e.printStackTrace();
}
于 2018-04-27T12:57:28.770 回答