且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 iphone 应用程序中设置 UINavigationBar 的高度

更新时间:2023-01-04 07:53:11

我不认为你可以改变导航栏的高度.除非您添加提示消息...但这不是您想要的.

I don't think you can change the height of a navigation bar. Except when you add a prompt message... But that's not what you want.

框架是视图的可见区域.Bounds 是内部区域.通常它的原点为 (0, 0) 并且与框架一样宽和高.但是,当内容超出可见区域时(例如 UIScrollView),边界可能会更大(并且原点不同).您很少看到小于其各自框架的边界.

Frame is the visible area of a view. Bounds is the internal area. Usually this has an origin of (0, 0) and is as wide and high as the frame. However, when the content exceeds the visible area (like with a UIScrollView) the bounds can be larger (and the origin different). You rarely see bounds that are smaller than their respective frames.

查看您的代码,[UINavigationController new] 是关于什么的?你应该做 [[UINavigationController alloc] init],不是吗?

Looking at your code, what is [UINavigationController new] about? You should do [[UINavigationController alloc] init], shouldn't you?

另外,你所做的并不是真正的子类化......

Also, what you are doing is not really subclassing...