【发布时间】:2014-06-21 06:13:09
【问题描述】:
// view controller implementation
@property (weak, nonatomic) IBOutlet UIView *v;
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
//self.v.layer.backgroundColor = [UIColor blackColor].CGColor;
CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI_4);
self.v.layer.affineTransform = transform;
}
@end
我已成功将UIView *v 连接到界面构建器中的UIView 对象。但是由于某种原因,当self.v.layer.affineTransform = transform; 被执行时,v 在我构建和运行它时从屏幕上消失了。这有什么问题?我该如何解决这个问题?在旁注中,我将对象的背景颜色设置为蓝色,以便它在屏幕上可见。
【问题讨论】:
-
你在应用变换之前检查过你的视图位置吗,变换代码很好,看起来你的视图没有出现在框架中。
-
在应用转换之前,我的视图位于屏幕中间。
标签: ios transform cgaffinetransform