How does the iOS app customize the height of the navigation? For example, the current system navigation height 44, want to change to 100. thanks
Xcode 11.1, iOS 13.1
it is possible but its not something what apple will approve when you send the app to the store rather than changing the height of the navigation bar you could make the bar view transparent and add a UIView which has the content.
Setting a custom navigation height won't pass the review process on the App Store. If you want a large NavigationBar you could always set the Bar to large titles:
navigationController?.navigationBar.prefersLargeTitles = true
Apple docs for large titles
Related
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?
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.
I want to make a navigation bar that changes height in it's detail view just like the messages app in iOS 10. How can I do that?
Edit:
I am looking to change the height dynamically. SizeThatFits() Permanently changes the height.
If you are trying to do something else that requires the navigation bar to be resized, that's not supported. iOS 11 and Above
Community bug reports
I have a UIViewController subclass which when I run the app on iOS 7, the status bar shows on top of my view. Is there a way to avoid this? I do not want the status bar to be hidden. Is there a way to show the status bar above my app. I present my view using presentViewController. Please guide what I am missing?
In Xcode, In storyboard there is an option of iOS6/7 delta. set delta Y to 20 pixel of your view, to make compatible with iOS7.For this you have to disable auto layout, you can use auto resizing.
This is quite common issue. Starting from iOS 7 Status Bar is a part of the controller's view. Apple even have added special attribute of UIView in the Interface Builder: iOS 6/7 Deltas. To fix your problem and make your view look the same in different iOS versions, go to Size inspector and set Delta Y to 20.0.
I want add 20 points margin to my navigation bar. I need it because I want another background color under status bar as youtube did:
I found
iOS Developer library says: Status bar background appearance provided by the window background, if using UIBarPositionTop.
I found solution for toolbar, but I can't move my navigation bar inside navigation view controller. I just set UIBarPositionTop for my navigation bar, but it changes nothing.
-(UIBarPosition)positionForBar:(id<UIBarPositioning>)bar {
NSLog(#"position method called");
return UIBarPositionTop;
}
I still see the gray background of status bar instead of white.
Is it possible to do it with a navigation bar or should I use a view with a toolbar?
(XCode 6, development target 7.0+, sdk 8.0, autolayout)
UPDATE: ANOTHER WAY TO RESOLVE PROBLEM
I read this question
and understood, that there is no need to add margin. I added view with background color I need over my navigation bar controller and it resolved my problem.
When you are adding your UIView to the UIWindow, you should change the UIViews size to not underlap the title bar. How to do this is well documented in this post:
Offset on UIWindow addSubview
I hope i understood correctly, look in size inspector, ios 6/7 deltas.
Check this link for an explanation:
Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?