on ‎2020 Oct 22 11:32 AM
Hi,
I have a viewController with a tableView (not UITableViewController) and a FUINavigationBar. When adding refreshControll, the animations doesn't work like they should, e.g the NavigationBar doesn't always move back up, and the loading indicator is just blinking for a split second. When changing the NavigationBar back to UINavigationBar, it works like it should.
Any suggestions on how to fix this for FUINavigationBar? Also, any idea why the whitespace on the top is there - it came with xcode 12 I believe..
https://media.giphy.com/media/azBxx0ez5KwdRWn5ux/giphy.gif
@IBOutlet weak var table: UITableView!
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(refresh), for: .valueChanged)
refreshControl.tintColor = .white //this is needed as it is grey/black by default
table.refreshControl = refreshControl
On a side note it seems to me that there is some custom code here, trying to mimic Apple's animation from large title to small title for example. When scrolling down on a NB with large title on UINavigationBar it transitions to small very smooth, but with FUINavigationBar, it kind of jumps from large to small.
Request clarification before answering.
In your case, please change the search bar to tableview header. i.e., change the following line
`navigationItem.searchController = searchController`
to
`tableView.tableHeaderView = searchController.searchBar`
Also, since this change will move the loading indicator to the table view header instead of the nevigation bar, the `refreshControl1.tintColor` you should change the color to a more noticable color than white, or just use the default color.
BTW, it is recommended to use `FUINavicationController` instead of `UINavigationController` to make the status bar text the correct color for iOS 13.4 and later. Note that simulators may display different color than the desired color, you need to use the real device to see the correct behavior.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.