Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 将子视图添加到iPad';UIView在Xcode 4.5中工作不正确_Objective C_Ios_Xcode4.5 - Fatal编程技术网

Objective c 将子视图添加到iPad';UIView在Xcode 4.5中工作不正确

Objective c 将子视图添加到iPad';UIView在Xcode 4.5中工作不正确,objective-c,ios,xcode4.5,Objective C,Ios,Xcode4.5,My.xib包含一个uitabar和3个视图: 我做了一个出口: @property (nonatomic, retain) IBOutlet UIView* _controllersContainerView; 在我的viewDidLoad方法中,我想向\u controllersContainerView添加一个子视图: [self controllersNavigationController].view.frame = _controllersContainerView.b

My.xib包含一个
uitabar
和3个视图:

我做了一个出口:

@property (nonatomic, retain) IBOutlet UIView* _controllersContainerView;
在我的
viewDidLoad
方法中,我想向
\u controllersContainerView
添加一个子视图:

    [self controllersNavigationController].view.frame = _controllersContainerView.bounds;
//  [self controllersNavigationController].view.frame = CGRectMake(0, 0, 350, 199);
    [_controllersContainerView addSubview:[self controllersNavigationController].view];
但是,即使我尝试将帧高度设置为超短值(199),它看起来也比
\u controllersContainerView
长,并且覆盖了
选项卡


代码有什么问题?它在带有armv6 v7的Xcode 4.4中运行良好,但在Xcode 4.5中失败。

将clipToBounds属性设置为YES,这可能会解决问题。

将选项卡栏拖到子视图列表的最前面(即底部)。@tkanzakic,我没有选项卡栏控制器,只有选项卡栏和3个视图。@my.xib选项卡栏中的CodaFi不包含任何视图。如果我将TabBar拖到最上面的视图,TabBar将覆盖_controllersContainerView。我希望视图和选项卡栏不重叠。我已尝试在添加子视图之前和之后将controllersNavigationController].view.clipsToBounds设置为“是”。No resultClipsToBounds仅适用于overdraw情况,而不适用于视图层次结构中较高层次的子视图。