我的代码是这样的:如何在定向发生时刷新UIView?
- (void)viewDidLoad
{
[self setGridView];
}
-(void)setGridView
{
CGRect frame;
frame .origin.x=0;
frame.origin.y=20;
frame.size.width=GRID_WEIGHT;
frame.size.height=GRID_HEIGHT;
GridView *ObjGridView=[[GridView alloc]initWithFrame:frame];
[[NSBundle mainBundle ] loadNibNamed:@"GridView" owner:ObjGridView options:nil];
[ObjGridView setGridViewFrame:frame];
[self.view addSubview:ObjGridView.GridCellView];
frame .origin.x+=GRID_WEIGHT;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
该代码添加一个子视图的视图,并设置帧
我的问题: 1 - 如何刷新我的看法时,方向(横向或纵向)发生, ,因为我在lanscape模式下设置子视图的框架,我也想在我的肖像视图中使用理智的视图(基本上我在哪里调用 - (void)setGridView委托方法)?
2我如何知道,我的子视图超出了视图的边界,以便我可以在我的setGridView方法中处理子视图?
是的,朋友它没有.. –