首页 > 移动平台 > 详细

iOS UIRefreshControl-刷新tableView

时间:2016-11-25 17:00:01      阅读:247      评论:0      收藏:0      [点我收藏+]

override func viewDidLoad() {
        super.viewDidLoad()
        refreshControl = UIRefreshControl.init()
        refreshControl?.attributedTitle = NSAttributedString.init(string: "努力加载....", attributes: [NSForegroundColorAttributeName:UIColor.yellow, NSFontAttributeName:UIFont.systemFont(ofSize: 20), NSTextEffectAttributeName: NSTextEffectLetterpressStyle])
        refreshControl?.tintColor = UIColor.yellow
        refreshControl?.backgroundColor = UIColor.init(patternImage: UIImage.init(imageLiteralResourceName: "1.jpg"))
        refreshControl?.addTarget(self, action: #selector(LPCTableVC.testRefresh), for: UIControlEvents.valueChanged)
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "Cell")
    }
    func testRefresh() {
        NSLog("刷新")
        //结束刷新
        refreshControl?.endRefreshing()
    }

iOS UIRefreshControl-刷新tableView

原文:http://www.cnblogs.com/yujidewu/p/6101967.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!