Prefer Large Titles and Refreshcontrol Not Working Well

Prefer Large Titles and RefreshControl not working well

At the end what worked for me was:

  • In order to fix the RefreshControl progress bar disappearing bug with large titles:

    self.extendedLayoutIncludesOpaqueBars = true
  • In order to fix the list offset after refreshcontrol.endRefreshing():

    let top = self.tableView.adjustedContentInset.top
    let y = self.refreshControl!.frame.maxY + top
    self.tableView.setContentOffset(CGPoint(x: 0, y: -y), animated:true)

UIRefreshControl renders behind UINavigation w/ Large Titles

It looks like you are setting the refresh control after the large navigation has been configured.

Try changing the order to something like this -

  override func viewDidLoad() {
super.viewDidLoad()

load()

configureTableView()
configureUI()
}
.......
func configureTableView() {
tableView.backgroundColor = .usingHex("fafafa")
tableView.tableFooterView = .init()
tableView.contentInsetAdjustmentBehavior = .always
tableView.refreshControl = .init()
}

func configureUI() {
navigationController?.navigationBar.prefersLargeTitles = true
navigationItem.title = "Latest content"
}

iOS 11 scroll to top when using large titles doesn't work properly

Okay so I found why the problem occurs, but not how to fix it in that exact scenario.

If you're using large titles and a UITableViewController with the navigation bar translucency set to off the problem will occur.
When you turn translucent back on the problem goes away.

If you're using a TableView in a normal UIViewController the problem always occurs.

Edit

Turns out setting "extendedLayoutIncludesOpaqueBars = true" fixes the problem if you're using a translucent navigation bar!

Similar question: UIRefreshControl() in iOS 11 Glitchy effect

UIRefreshControl endRefresh jumps when used with Large Title enabled

The problem is related to layout.estimatedItemSize = CGSize(width: 20, height: 20)

When we use AutoLayout to resize the cell, it creates a bug with UIRefreshControl and navigation bar large title. So, if you use layout.estimatedItemSize with an equal or greater size than we expected. So the bug will not happen and the glitch will not happen.

Basically, the problem is when we call updateData but the cell is bigger than we expect and each cell of the UICollectinView will resize to a bigger size then the UICollectionViewController will glitches.

How to add refresh control to collection view large titles navigation bar in iOS 11?

As of iOS 10, UITableView and UICollectionView has refreshControl property.

So, instead of:

tableView.addSubview(refreshControl)

you do:

tableView.refreshControl = refreshControl

and this should work for new big headers in iOS 11.

UIRefreshControl in a UIScrollView is not triggered when Large title is used

I had the same problem a while ago and for me I could make it work by calling scrollView.refreshControl.didMoveToSuperview() in viewDidAppear.



Related Topics



Leave a reply



Submit