UIImageView设置为圆形

  UIImageView设置为圆形

  CGFloat headimageX = self.view.frame.size.width * 0.2;

CGFloat headimageY = self.view.frame.size.height * 0.25;

CGFloat headimageW = self.view.frame.size.width * 0.6;

CGFloat headimageH = headimageW;

UIImageView *headimageview  = [[UIImageView alloc] init];

headimageview.frame = CGRectMake(headimageX, headimageY, headimageW, headimageH);

//这句必须写

headimageview.layer.masksToBounds = YES;

headimageview.layer.cornerRadius = headimageW * 0.5;

headimageview.image = [UIImage imageNamed:@"1"];

[self.view addSubview:headimageview];

上一篇:Redis缓存中的常见问题


下一篇:Redis缓存设计与性能优化