【发布时间】:2011-08-03 06:23:23
【问题描述】:
我有一个配置 UITableView 可以通过 UINavigationController 方法启动颜色选择器:
[self.navigationController pushViewController:colorPickerViewController animated:YES];
[colorPickerViewController release];
这样的效果意味着颜色选择器顶部会有一个导航栏(和返回按钮)
ColourPickerViewControll及其视图ColourPickerView的结构如下:
- ColourPickerViewController - in it's XIB file at the top level view it has:
- ColorPickerView : UIView (i.e. custom UI view) - in it's methods it has:
- (id)initWithCoder:(NSCoder*)coder {
if ((self = [super initWithCoder:coder])) {
CGFloat currVertBounds = self.bounds.size.height;
这里的问题是 currVertBounds 的值是 480,所以它没有考虑到导航栏
问题:如何获取 ColorPickerView 实例的真实显示高度?
这是否与尝试在自定义 UIView 中计算布局有关,并且可能在那个阶段自定义视图未在整体 controll/navigationController 中呈现?
【问题讨论】:
-
你想改变导航栏或nt的高度。
标签: iphone ios uiview uinavigationcontroller bounds