隐藏时,圆形图像视图为矩形

时间:2017-08-14 06:56:16

标签: ios objective-c

我制作一个圆形的imageView。这是代码:

someImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.bounds.size.width/2-35,80,80,80)];

[someImageView setContentMode:UIViewContentModeScaleAspectFit];
someImageView.layer.cornerRadius = someImageView.frame.size.height /2;
someImageView.layer.masksToBounds = YES;
someImageView.layer.borderWidth = 1.0;
someImageView.layer.borderColor = [UIColor colorWithRed:16.0f/255.0f
                                                  green:56.0f/255.0f
                                                   blue:70.0f/255.0f
                                                  alpha:1.0f].CGColor;
someImageView.clipsToBounds=YES;
[self.view addSubview:someImageView];

但是当我隐藏它时,我注意到一个矩形(原始大小)很短的时间然后隐藏。为什么会这样?当我隐藏是或否时,我想让它成为循环。

0 个答案:

没有答案