【发布时间】:2014-06-05 14:20:51
【问题描述】:
我有这样的视图:
_myController = [[MSCustomViewController alloc] init];
_myController.doc = (AWDOC *)_currentDocumentViewController.activeFile.document;
_myController.view.backgroundColor = [UIColor colorWithHue:0.7/3.3 saturation:0.2 brightness:1.0 alpha:1.0];
[self.view insertSubview:_myController.view aboveSubview:_myController];
CGSize size = [_myController.view sizeThatFits:CGSizeZero];
if(size.height < _myController.frame.size.height)
size.height = _myController.frame.size.height;
CGRect myFrame = CGRectMake(0., CGRectGetMinY(_currentDocumentViewController.view.bounds) + (CGRectGetHeight(_currentDocumentViewController.view.bounds) - size.height) / 2., size.width, size.height);
_myController.view.frame = myFrame;
CGRect buttonFrame = CGRectMake(CGRectGetMaxX(myFrame), CGRectGetMinY(myFrame), myButton.frame.size.width, CGRectGetHeight(myFrame));
_myButton.frame = buttonFrame;
[_myButton setTitle:@"<" forState:UIControlStateNormal];
“使用上下文或 Draw 绘制此视图”是什么意思?
【问题讨论】:
-
您能否再解释一下您是从哪里收到此消息的?
-
这只是一项任务
-
还是不清楚,这是错误信息吗?
-
不,这不是错误。我只是想知道我是否可以使用一些 Draw(cgrect 等) 或 CGContext 方法来绘制视图
-
您可以使用 CGContext 方法绘制视图,以明确“在上下文中绘制视图”参见stackoverflow.com/questions/22740543/…
标签: ios objective-c uiview draw cgcontext