开发者

How to place and rotate UIImageView that is larger than screen active area?

I have an image that represents sun rays and I need to make rotate those sun rays on iphone 4 screen. The very intuitive solution that comes to my head is to have quite large image, put it in UIImageView, set its anchor point and then use CA animation (animation). I'm designing my UI with interface builder and the problem is I'm unable to put large image that is larger than active screen (root view) size to UIImageView because is just crops i开发者_运维技巧t. Any thoughts and solutions?


Maybe something like this (in code, not in IB):

UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"starburst.png"]];
img.center = CGPointMake (0, 0);
[self.view addSubview:img];

Then, to animate it, maybe something like this:

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0f];
img.alpha = 0.0f;
[img release];
[UIView commitAnimations];

(Don't forget to release the img when you're done using it -- I did it above as an example, but you could move the release anywhere you needed)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜