【问题标题】:How to customize UIRefreshControl with different image and position?如何使用不同的图像和位置自定义 UIRefreshControl?
【发布时间】:2013-05-16 12:56:47
【问题描述】:

我一直在环顾四周,但找不到任何关于此的好消息。

我想用不同的加载器等自定义默认UIRefeshControl。到目前为止,我只能更改tintColorattributedTitle属性,我发现的大多数代码基本上只是创建一个新的"pulltorefresh"效果但是什么我想要的是只使用UIRefreshControl 并对其进行一些自定义。

这可能吗?

【问题讨论】:

标签: ios customization uirefreshcontrol


【解决方案1】:

你不能在不访问私有API的情况下添加不同的加载器,但你可以添加背景图片:

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

假设 self 是 UITableViewController 子类的一个实例。

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

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

【讨论】:

  • 请检查这个问题 --> stackoverflow.com/q/67056902/15466427
  • 我只想在加载器之前在collectionView上设置一个向下箭头,指示用户向下拉collectionView进行刷新,并在加载器出来时关闭箭头
猜你喜欢
  • 1970-01-01
  • 2018-06-28
  • 2019-02-05
  • 2016-01-06
  • 1970-01-01
  • 1970-01-01
  • 2011-12-05
  • 1970-01-01
相关资源
最近更新 更多