如何自定义具有不同图像和位置的UIRefreshControl?

时间:2013-05-16 12:56:47

标签: ios customization uirefreshcontrol

我一直在四处寻找但却找不到任何好的东西。

我想使用不同的加载程序等自定义默认UIRefeshControl。到目前为止,我只能更改tintColor& attributedTitle属性和我发现的大多数代码基本上都是创建一个新的"pulltorefresh"效果,但我想要的只是使用UIRefreshControl并稍微自定义。

这可能吗?

1 个答案:

答案 0 :(得分:8)

如果不访问私有API,则无法添加不同的加载程序,但可以添加背景图像:

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

假设self是UITableViewController子类的实例。

您需要的图像尺寸为320x43px(@ 2x 640x86px),加载器动画将覆盖中间区域(约35px)。

我在那里显示应用徽标......

相关问题