UIRefreshControl Background Color

前端 未结 3 965
太阳男子
太阳男子 2021-02-04 06:02

Is it possible to make the background of a UIRefreshControl grow as the control grows?

I would like to have a colored background for the refresh control to match the top

3条回答
  •  死守一世寂寞
    2021-02-04 06:45

    This can now be achieved (Swift 5, iOS 13) by simply setting the UIRefreshControl background color property:

    let ctrl = UIRefreshControl(frame: .zero)    
    ctrl.backgroundColor = UIColor.gray'
    tableView.refreshControl = ctrl
    

提交回复
热议问题