我想修改框架的UIImageView
当一个特定的旋转发生,但当我改变它的UIImage内UIImageView
看起来不受影响,如果我NSLog UIImageView
帧大小改变了,但它没有反映在观点上,为什么会发生这种情况?更改框架的UIImageView
@property (strong, nonatomic) IBOutlet UIImageView *couponBg;
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if ((UIInterfaceOrientationIsPortrait(fromInterfaceOrientation)) &&
UIDeviceOrientationLandscapeRight == [[UIDevice currentDevice] orientation]) {
self.couponBg.frame = CGRectMake(0, 0, self.couponBg.frame.size.width, self.couponBg.frame.size.height);
NSLog(@"FRAME:%@", NSStringFromCGRect(self.couponBg.frame));
self.couponBg.frame = CGRectZero;
NSLog(@"FRAME:%@", NSStringFromCGRect(self.couponBg.frame));
}
}
我得到正确的帧大小中的NSLog:
2013年11月23日17:05:00.674 - - - - [10302:70B] FRAME:{{0,0} ,{320,199}}
2013年11月23日17:05:00.674 - - - - [10302:70B] FRAME:{{0,0},{0,0}}
但在视图中图像总是相同的大小?这是为什么发生?
我认为最有可能的罪魁祸首是,你实际上没有将已添加到你的视图中的'UIImageView'分配给'self.couponBg'你能证实你已经完成了吗? – Adam