如何在objective-c中创建和定位新的imageview?Cocoa Touch - 以编程方式添加UIImageView?
谢谢!
我试过,但它似乎没有做任何事情...
-(void)drawStars{ //uses random numbers to display a star on screen
//create random position
int xCoordinate = arc4random() % 10;
int yCoordinate = arc4random() % 10;
UIImageView *starImgView = [[UIImageView alloc] initWithFrame:CGRectMake(xCoordinate, yCoordinate, 58, 40)]; //create ImageView
starImgView.image = [UIImage imageNamed:@"star.png"];
[starImgView release];
我把这个方法在我的ViewController。我看到一些需要导入核心图形的CG东西吗? (无论如何,什么是核心图形?)
如何定义要显示的图像? 是的,可可触摸只是iPhone。 – user377419 2010-07-23 20:52:25
也是什么限制的位置..像什么最大值之前,它熄灭屏幕? – user377419 2010-07-23 20:59:35
回答编辑。希望它对你有所帮助。 – taskinoor 2010-07-24 03:28:00