Auto Resizing UINavigationBar on rotation to landscape
[[UINavigationBar appearance] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin];
But you didn't say flexible height. Yet height, as I understand it, is the very feature you wish to be flexible.
UIRefreshControl hidden / obscured by my UINavigationController's UINavigationBar
For those targeting iOS 7, there seems to be a new issue present where the UIRefreshControl
is drawn behind the UITableView
's backgroundView
. I experienced this both when initializing the UIRefreshControl
programatically and from a storyboard. A simple workaround is to update the zPosition
of the UIRefreshControl
in viewDidLoad
of your UITableViewController
:
self.refreshControl.layer.zPosition = self.tableView.backgroundView.layer.zPosition + 1;
Navigation bar title updates too late (Swift)
Try this code:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "CategorySelected") {
DispatchQueue.main.async {
let vc = segue.destination as! SearchOrgTableViewController
vc.category = selectedCategory
vc.title = category.name } }
}
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)
How to transition smoothly from translucent to opaque UINavigationBar iOS?
I finally found a decent solution!
There doesn't appear to be a proper way to smoothly transition from an opaque to transparent UINavigationBar
BUT you can transition smoothly from a view controller with a visible status bar to one that has a hidden status bar.
This opens up a possible workaround which is to add the following in the viewWillAppear
of VC2 from above:
[self.navigationController setNavigationBarHidden:YES animated:YES];
Once you have that, manually add a UINavigationBar
to your xib and configure it to be transparent (and add all necessary UIBarButtonItem
and views).
If everything is hooked up properly transitioning from VC1 to VC2 will hide the UINavigationBar
at the same speed as the view transition and VC2 will show up with it's embedded UINavigationBar
Note: To make this work properly you'll have to make sure that in the viewWillAppear
of View Controllers that can be accessed from VC2 you reset the UINavigationBar
to be visible (if necessary) via:
[self.navigationController setNavigationBarHidden:NO animated:YES];
TL;DR - manually add a UINavigationBar
to your transparent nav bar view controller and in its viewWillAppear
hide the default one via setNavigationBarHidden:animated:
Related Topics
Change Uipopoverview Background + Arrow Color
How to Get Camera Calibration Data on iOS? Aka Avcameracalibrationdata
How to Change the Number of Decimal Places iOS
Admob Interstitial Alway Returns False
How to Instantiate and Load a View Controller Before Segueing to It Using Swift
Routing Between Points with Mapbox
How to Draw a Simple Rounded Rect in Swift (Rounded Corners)
How to Deal with Dynamic Sections and Rows in iOS Uitableview
Uitableviewcell Custom Class - Reload Cell Height After Change in Subview Height Constraint
Scaling Physics Bodies in Xcode Spritekit
Dyld: Symbol Not Found: _Tmpdcss12Anygenerator
Expand Uitextview and Uitableview When Uitextview's Text Extends Beyond 1 Line
How to Create an Alert in a Swift File Model That Works for Various View Controller
Xcode 9: Swift Dependency Analysis Error
Unrecognized Selector Sent to Instance Swift 3
Swift 3 - Passing Data Between a View Controller and After That to Another 2
Allow Users to Send Messages to Multiple Users Simultaneously in a Messaging App