UISplitView – multitask, navigationItem's titleView missing after resizing - ios

I am having a very weird problem for iPad's multi-tasking resizing. This is how i set up my titleView:
navigationItem.titleView = theView
And I resize the SplitView in iPad multi-tasking so I can have two apps running side by side. After a few size changing, my titleview is missing from the UI.
Debugging it from the log, it is still in the navigationItem's titleview hierarchy but just not showing?
Any ideas?

I am having the exact same issue and have yet to find a resolution. When using the title property it works great, but using titleView the view will disappear at times when changing sizes when multitasking.

I found the following seems to have fixed my issue:
Assuming the view you want to place as the title view on the navigation item is declared as self.titleView:
[self.titleView.widthAnchor constraintEqualToConstant:44.0].active = true;
Hope that helps anyone else looking for the same thing.
I found this via this article:
Custom title view as large title in iOS 11 new navigation bar

Related

IOS 11 navigation bar appears smaller than it should

I have a custom navigation bar that worked well until iOS 11. It appears smaller than it should and seems to ignore the status bar height or something.
I set the whole thing programmatically and the height is set to 64.
have you tried to disable (untick) safe area?

Preventing UINavigationController transitions animating upwards with an offset in iOS 11?

I'm updating an app from iOS 10 to iOS 11 with an iOS 9 target and this happens on every segue animation when a navigation bar is involved.
The animation starts with a small offset lower than the height it should be at and then moves to the proper height by the time the view has finished animating.
I'm not doing anything special to the navigation controllers, and it happens to each one in the app. If I programatically hide the navigation bar, the transitions animate normally.
Setting the tableView.contentInsetAdjustmentBehavior to .never in a UINavigationController fixes the problem.
Edit: Actually a better solution is to activate the Under Opaque Bars option for the TableViewController instead.
Otherwise the vertical scroll bars will be behind the iPhone X notch in landscape mode. This worked for me, because I use opaque bars. I don't know what happens if you use translucent bars.
The original solution is described by Prince on the Apple Developer Forums:
After some research ...I found that automaticallyAdjustsScrollViewInsets is deprecated in iOS 11, Now we are to use contentInsetAdjustmentBehavior in UIScrollView type views instead. Setting contentInsetAdjustmentBehavior to .never worked and also the 'UINavigationController translation slide up issue' wouldn't happen if the UINavigationBar is transulcent where the view is under the bar. (Thus the new way of doing the automaticallyAdjustsScrollViewInsets`)
This is not good for Storyboard users because this will have to be done in code.
The top/bottom layout guides were deprecated in iOS11 and I think your issue is connected to this. So you can change the constraints I think.
Read more here.

Navigation Bar not showing in Storyboard in Xcode 6

I know this question has been asked before. I have already tried this Navigation Bar not showing in Storyboard. I have a navigation bar and a toolbar. They were showing in the storyboard fine before I restarted my system. They work completely fine during runtime but I am no longer able to access it using Storyboard. I have also tried changing top bar for Simulated metrics. Here is the screenshot for the same.
Make sure it is ticked here for Navigation Controller in Storyboard:
Try This seems like your frame is misplaced from the top and not according to the constraint too

NavigationBar clipping background image in iOS7 ;ClipsToBound:NO not working

I have set a background image slightly bigger than the navigationBar.The image is 55px in height.[I want a banner looking image with ribbon at the bottom of nav bar]
It was working ok in iOS6.
But in iOS7, its getting clipped by itself.
I tried setting
[self.navigationController.navigationBar setClipsToBounds:NO];
It's still getting clipped.
Can't I have a bigger background image without getting clipped?
this is due to Ui navigation bar is 64 point in ios7 that why this create problem.
refer this link https://developer.apple.com/library/ios/documentation/userexperience/conceptual/transitionguide/Bars.html refer table 5-1 that is give you idea that for resizable image what are the change in new ios7
you can use UIBarPositioning propety to solve your problem not sure but that may help you
refer this link for more info related to UIBarPositioning
https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/occ/intfp/UIBarPositioning/barPosition
Edited
also try by set this flag
navigationBar.translucent = NO;
for more info refer this link
iOS 7 UINavigationBar - UIView layout issue
The image is not getting clipped, it is most probably just too small.
The UINavigationBar is 64 points in iOS 7, so the 55px image will be too small, especially considering the retina resolution where 128px would be needed.
set the delegate of your navigation bar to your view controller, and return UIBarPositionTopAttached in delegate method. return the position which you want to see
- (UIBarPosition)positionForBar:(id<UIBarPositioning>)bar
https://developer.apple.com/library/ios/documentation/uikit/reference/UIBarPositioning_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UIBarPositioning

UISplitView with UITabbar

I have a strange one that I can not seem to fix. I am currently working on updating my app to iOS7. This all worked in iOS6. It is an universal app and thus uses same xib files. However the iPad uses UISplitViews on some. Like I said, this all worked in iOS6 oh this all works on the iPhone too.
The problem is a grey bar at the bottom. I changed the tab bar to be opaque to move views up properly as i had some UI clipped to bottom of views and that went underneath the tab bar, sidetracked there. But if i set it back to translucent bar, it goes underneath but stretched properly. if i dont, it adds a bar. Other tabs work fine when NOT using splitview.
The UISplitviewController is added programmatically.
See attached image for better description.
This I have tried:
Added autoresize on splitview
Checked xib for subviews in the splitviews to have auto resize
Tried to force splitview to be screen bounds
Removed clips to bounds on all views
Removed autoresize subviews
Any ideas would be welcomed.
Thank you all.
UPDATE:
setting the background colour the uisplitview, it does colour the bar black. So the uisplitview is definitely stretching to it.
I subclassed UISplitViewController and added the line below to viewDidLoad and that fixed the grey line.
self.extendedLayoutIncludesOpaqueBars = YES;
I believe I have found an alternative solution for you. I have had the exact same problem, mostly because we are both doing something against Apple's Guidelines which is having a SplitViewController nested within a Tabbar controller (SplitView should be the root view). This was okay in iOS 5/6, but now in iOS 7 there are far too many side effects to achieve this.
The reason you see your view stretch completely when you set the bar to be translucent is because the bar is NOT taken into account when drawing the view. When you set translucent to false, it is then taken into account of the view and you will see that grey bar there because that's your view pretending there's a tabbar at the bottom of the screen.
And as always, a SplitViewcontroller's height cannot be changed, as it is determined by the visible window height.
I tried everything you did and then some. The real solution came from using a third-party Split View Controller.
I recommend switching over to https://github.com/mattgemmell/MGSplitViewController . This split view controller is actually one large View with container views living inside of it. Because of this, you avoid all the side effects of putting an actual split view controller within a tab bar.
If that doesn't float your boat, you could create your own solution which follows the same idea of having one UIViewController with two container views contained in it, though the people behind MGSplitViewController did a good job of that already.
This was the only way I was able to solve this issue, let me know if you find an alternative.
Instead of creating a subclass for UISplitViewController, I just added this code on my master's viewDidLoad:
self.splitViewController?.extendedLayoutIncludesOpaqueBars = true
For the controller that is the detail view of UISplitViewController you just do this:
-(UITabBarController*)tabBarController{
return nil;
}

Resources