您的位置:首页 > 产品设计 > UI/UE

UIImage

2016-03-12 21:11 351 查看

code

图片,和灰色边界的圆型图片

UIImageView *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
[self.view addSubview: myImageView];
[myImageView release];
myImageView.image = [UIImage imageNamed:@"图片.jpg"];

// 制作圆形图片
myImageView.layer.masksToBounds = YES;
myImageView.layer.cornerRadius = CGRectGetHeight(myImageView.bounds) / 2;
myImageView.layer.borderWidth = 0.5f;
myImageView.layer.borderColor = [[UIColor lightGrayColor] CGColor];


组图动画

UIImageVi
a592
ew *myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
[self.view addSubview: myImageView];
[myImageView release];

// 初始化一个用来装所有图片的空数组
NSMutableArray *picArr = [NSMutableArray array];
for (NSInteger i = 0; i < 组图的张数; i++) {
NSString *picStr = [NSString stringWithFormat:@"图片"];
UIImage *image = [UIImage imageNamed: picStr];
[picArr addObject: image];
}

myImageView.animationImages = picArr;
myImageView.animationDuration = 1;
myImageView.animationRepeatCount = 0;
[myImageView startAnimating];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: