2 starwar2012 starwar2012 于 2013.01.23 10:06 提问

iphone-UIButton中的动画gif

我写的代码运行之后,160*148尺寸的图片变的非常大,全屏了……

UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:self.view.bounds];
animatedImageView.animationImages = [NSArray arrayWithObjects:    
                               [UIImage imageNamed:@"button1.png"],
                               [UIImage imageNamed:@"button2.png"],
                               [UIImage imageNamed:@"button3.png"],
                               [UIImage imageNamed:@"button4.png"], nil];
animatedImageView.animationDuration = 1.0f;
animatedImageView.animationRepeatCount = 0;
[animatedImageView startAnimating];
[yourButton addSubview: animatedImageView];

这个应该怎么解决?

2个回答

zj382561388
zj382561388   2015.08.24 23:36

楼主在初始化UIImageView的尺寸时 是否设置错了frame

UI_51_W
UI_51_W   2016.06.16 21:43

imageview 属性设置呢1234567

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!