首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UIViewController实例的CGRectMake

UIViewController实例的CGRectMake
EN

Stack Overflow用户
提问于 2012-07-03 23:57:14
回答 1查看 217关注 0票数 0

我知道在另一个UIViewController中显示UIViewController是不明智的,但我不知道还能怎么做。我有一个3D视图控制器(ThreeDViewController),它可以显示3D对象,并允许用户旋转和放大对象。我希望能够对仍然允许在我的SideBySideViewController上进行交互的ThreeDViewController进行一个小视图。

代码语言:javascript
复制
  self.ViewInstance = [[ThreeDViewController alloc]init];
  [self.view addSubview:self.ViewInstance.view];

这就是我到目前为止所拥有的,但它只导入了UIViewController,所以它占据了整个屏幕,我想要一个设置大小的框。而且initWithFrame也不能工作。

谢谢!

EN

回答 1

Stack Overflow用户

发布于 2012-07-04 00:51:09

代码语言:javascript
复制
float scaleFactor = 0.5;
    CGRect temp = CGRectMake(self.ViewInstance.view.frame.origin.x, self.ViewInstance.view.frame.origin.y,self.ViewInstance.view.frame.size.width*scaleFactor, self.ViewInstance.view.frame.size.height*scaleFactor);
    self.ViewInstance.view.frame = temp;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11314756

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档