当前位置:网站首页>Is there any way to change the height of the uinavigationbar in the storyboard without using the UINavigationController?
Is there any way to change the height of the uinavigationbar in the storyboard without using the UINavigationController?
2022-07-05 03:03:00 【fyin1314】
problem :
I want to use a custom UINavigationBar
in one of my views, which is not a part of any UINavigationController
-hierarchy. I want to use customization in one of my views UINavigationBar
, It's not any UINavigationController
Part of the hierarchy .When I drag a UINavigationBar
into Storyboard, it shows like this: When I will UINavigationBar
Drag in Storyboard when , It shows as follows :
This bar is 44px, which would be enough if the status bar wouldn't share this space. This one is 44 Pixels , If the status bar doesn't share this space, it's enough .Because iOS7 lets us use the entire screen, including the space for the status bar, the UINavigationBar
should be 64px tall, not 44px. because iOS7 Allow us to use the entire screen , Space including status bar , UINavigationBar
Should be 64px high , instead of 44px.
If I connect the view to a UINavigationController
's hierarchy, then it shows correct: If I connect the view to UINavigationController
Hierarchical structure , Then it displays correctly :
I read somewhere that if the UINavigationBar
has the property barPosition:
set to UIBarPositionTopAttached
, then the bar would be 64px. I read somewhere , If UINavigationBar
Properties of barPosition:
Set to UIBarPositionTopAttached
, Then the bar will be 64px.This is, however, a readonly
-property. However , This is a readonly
attribute .
My search results have only shown something I consider a "work-around". My search results only show what I think is “ resolvent ” The problem of .By adding a useless UINavigationController
before this UIViewController
, I can pretend to have a hierarchy, and it will add the UINavigationBar
with 64px automatically. Through this UIViewController
Before adding a useless UINavigationController
, I can pretend to have a hierarchy , It will automatically add with 64px Of UINavigationBar
.
Is there really no way to have a 'rogue'(without the help of a navigation controller) UINavigationBar
that covers 64px? Really? There is no way to make ' rogue '( Without the help of the navigation controller ) UINavigationBar
Cover 64px Do you ?If that is the case, is there any valid reasons as to why? If so , Is there any justification for ?
(I'm not saying the UINavigationBar
should be 64px by default, but there should be an option for it in the inspector)( I'm not saying by default UINavigationBar
Should be 64px, But there should be an option in the inspector )
(I also see people answering with programmatic ways to solve this. Even though these answers works, I'd still have to design the storyboard with that in mind (a gap). What I want to know is if it's possible to set this in storyboard, or rather, why isn't it allowed?)( I also see people solve this problem in a procedural way . Although these answers are valid , But I still need Design The storyboard , Consider this ( disparity ). What I want to know is , Whether it can be set as a storyboard , Or say , Why not allow ?)
Solution :
Reference resources : https://stackoom.com/en/question/1Nl9z边栏推荐
- The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
- Azkaban installation and deployment
- ELK日志分析系统
- Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
- Hmi-32- [motion mode] add light panel and basic information column
- Sqoop安装
- Azkaban安装部署
- College Students' innovation project management system
- GFS distributed file system
- Anchor free series network yolox source code line by line explanation four (a total of ten, ensure line by line explanation, after reading, you can change the network at will, not just as a participan
猜你喜欢
Anchor free series network yolox source code line by line explanation Part 2 (a total of 10, ensure to explain line by line, after reading, you can change the network at will, not just as a participan
Sqoop command
Asp+access campus network goods trading platform
端口,域名,协议。
Cut! 39 year old Ali P9, saved 150million
SQL performance optimization skills
Design of kindergarten real-time monitoring and control system
Tiny series rendering tutorial
qrcode:将文本生成二维码
Design and practice of kubernetes cluster and application monitoring scheme
随机推荐
Bumblebee: build, deliver, and run ebpf programs smoothly like silk
1. Five layer network model
Sqoop installation
Pat class a 1160 forever (class B 1104 forever)
[Yu Yue education] National Open University autumn 2018 8109-22t (1) monetary and banking reference questions
Clean up PHP session files
【LeetCode】98. Verify the binary search tree (2 brushes of wrong questions)
Talk about the SQL server version of DTM sub transaction barrier function
单项框 复选框
Last words record
2021 Li Hongyi machine learning (1): basic concepts
问下,这个ADB mysql支持sqlserver吗?
LeetCode --- 1071. Great common divisor of strings problem solving Report
[2022 repair version] community scanning code into group activity code to drain the complete operation source code / connect the contract free payment interface / promote the normal binding of subordi
Ubantu disk expansion (VMware)
Design and practice of kubernetes cluster and application monitoring scheme
Moco V2 literature research [self supervised learning]
Single line function*
Scientific research: are women better than men?
Spark SQL learning bullet 2