Ios5 查看清除区域

Ios5 查看清除区域,ios5,uiviewcontroller,ios6,iphone-5,ios4,Ios5,Uiviewcontroller,Ios6,Iphone 5,Ios4,这是一个继承的代码,我想更改尽可能少,只支持iphone5(taler)屏幕大小 我在某个地方有这样一个代码: [self.view addSubview:leftSwipedViewController.view]; 问题是:父UIViewController已填充480x2->568x2区域(iphone4和iphone5之间的差异)。新的滑动UIController将填充0->480x2高度区域。我想用一个漂亮的白色来清理剩余的空间。怎么做 类似于[self.view clearRect

这是一个继承的代码,我想更改尽可能少,只支持iphone5(taler)屏幕大小

我在某个地方有这样一个代码:

[self.view addSubview:leftSwipedViewController.view];
问题是:父UIViewController已填充480x2->568x2区域(iphone4和iphone5之间的差异)。新的滑动UIController将填充0->480x2高度区域。我想用一个漂亮的白色来清理剩余的空间。怎么做

类似于
[self.view clearRectangle(0568-480320568,color.white)]但此函数不存在


有没有更好、快捷的解决方案我不想为一个代码创建一个xib文件,其中组件从代码中放置到X,Y坐标。

是的,实际上非常简单

在添加视图之前,请执行以下操作:

UIView *whiteView = [[UIView alloc] initWithFrame:self.view.bounds];
whiteView.tag = 123; // you'll need it if you want to remove it later.
whiteView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:whiteView];

[self.view addSubview:leftSwipedViewController.view];
[[self.view viewWithTag:123] removeFromSuperview];
如果要删除它,请执行以下操作:

UIView *whiteView = [[UIView alloc] initWithFrame:self.view.bounds];
whiteView.tag = 123; // you'll need it if you want to remove it later.
whiteView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:whiteView];

[self.view addSubview:leftSwipedViewController.view];
[[self.view viewWithTag:123] removeFromSuperview];
但是,正确的方法是使leftSwipedViewController同时支持两种高度