Offsetting UIRefreshControl

前端 未结 9 1528
醉话见心
醉话见心 2020-12-14 01:14

I am currently using a JASidePanel for my application and I have a UITableViewcontroller with a UIRefreshControl as one of the ViewControllers for it. The width of my tablev

9条回答
  •  执念已碎
    2020-12-14 01:34

    For Swift 2.2 solution is

    let offset = -50
    
    let refreshControl = UIRefreshControl()
    refreshControl.bounds = CGRect(x: refreshControl.bounds.origin.x, y: offset,
                                   width: refreshControl.bounds.size.width,
                                   height: refreshControl.bounds.size.height)
    refreshControl.attributedTitle = NSAttributedString(string: "Pull to refresh")
    refreshControl.addTarget(self, action: #selector(networking), forControlEvents: UIControlEvents.ValueChanged)
    self.profileTable.addSubview(refreshControl)
    

    Thats it.

提交回复
热议问题