How to customize UIRefreshControl with different image and position?

前端 未结 1 653
一生所求
一生所求 2020-12-15 00:11

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

I would like to customize the default UIRefeshControl with different loader, et

1条回答
  •  囚心锁ツ
    2020-12-15 00:51

    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...

    0 讨论(0)
提交回复
热议问题