I've UIViewController and another UIView with some images and labels on it.
我想改变方向并且效果很好,我可以在旋转设备时改变aqGridview 框架,
我的代码:
- (void)makePortraitOrientation {
[gridView setFrame:CGRectMake(0, 43, 768,961)]; //works like a charm
HeaderView* dsd = [[HeaderView alloc] initWithParentID:self]; // in this way there is no errors but nothing changes
[dsd.label setFrame:CGRectMake(0, 0, 0, 0)];
[dsd setNeedsDisplay];
[self.HeaderView.label setFrame:CGRectMake(0, 0, 0, 0)]; //error, no object HeaderView in UIViewController
[self.HeaderView.label CGRectMake]
}
UIView的头文件
@interface HeaderView : UIView{
id parentID;
UIButton *menu;
UIImageView *icon;
NSString *product;
THLabel *label;
NSMutableArray *backs;
}
主要问题是如何更改位于另一个 UIView 而不是我的 UIViewController 中的图像和标签的框架和位置?
以编程方式创建的所有视图。