当前位置:网站首页>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边栏推荐
- 腾讯云,实现图片上传
- Voice chip wt2003h4 B008 single chip to realize the quick design of intelligent doorbell scheme
- tuple and point
- Bumblebee: build, deliver, and run ebpf programs smoothly like silk
- Pat grade a 1119 pre- and post order traversals (30 points)
- Qrcode: generate QR code from text
- d3js小记
- [200 opencv routines] 99 Modified alpha mean filter
- El select, El option drop-down selection box
- Dart series: collection of best practices
猜你喜欢

The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety

Azkaban installation and deployment

Acwing第 58 场周赛【完结】

Sqoop command

Sqoop命令

Character painting, I use characters to draw a Bing Dwen Dwen

Why are there fewer and fewer good products produced by big Internet companies such as Tencent and Alibaba?

端口,域名,协议。

Design and implementation of campus epidemic prevention and control system based on SSM

TCP security of network security foundation
随机推荐
Problem solving: attributeerror: 'nonetype' object has no attribute 'append‘
qrcode:将文本生成二维码
端口,域名,协议。
Design and implementation of kindergarten management system
040. (2.9) relieved
为什么腾讯阿里等互联网大厂诞生的好产品越来越少?
Avoid material "minefields"! Play with super high conversion rate
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Use UDP to send a JPEG image, and UPD will convert it into the mat format of OpenCV after receiving it
LeetCode146. LRU cache
有个疑问 flink sql cdc 的话可以设置并行度么, 并行度大于1会有顺序问题吧?
The database and recharge are gone
SPI and IIC communication protocol
Tiny series rendering tutorial
Talk about the SQL server version of DTM sub transaction barrier function
Avoid material "minefields"! Play with super high conversion rate
Clean up PHP session files
Eight days of learning C language - while loop (embedded) (single chip microcomputer)
【微服务|SCG】Filters的33种用法
SFTP cannot connect to the server # yyds dry goods inventory #