How to customize UIRefreshControl with different i

2019-01-22 23:08发布

I have been looking around but couldn't find anything good about this.

I would like to customize the default UIRefeshControl with different loader, etc. So far I can only change tintColor & attributedTitle properties and most code I found are just basically creating a new "pulltorefresh" effect but what I want is to just use the UIRefreshControl and customize it a bit.

Is this possible?

1条回答
仙女界的扛把子
2楼-- · 2019-01-22 23:20

You can't add different loader without accessing private APIs, but you can add background image:

UIImageView *rcImageView =
    [[UIImageView alloc] initWithImage:
        [UIImage imageNamed: @"refreshControl.png"]];
[self.refreshControl insertSubview:rcImageView atIndex:0];

assuming self is an instance of UITableViewController subclass.

Image size you need is 320x43px (@2x 640x86px), the middle area (approximately 35px) will be covered by the loader animation.

I show application logo there...

查看更多
登录 后发表回答