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()
    }

相关文章:

  • 2022-12-23
  • 2021-07-25
  • 2021-12-12
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
相关资源
相似解决方案