Objective c 在Xcode上显示图像
我是xcode的初学者,我想制作一个项目,其中我有一些按钮,当我触摸按钮时,一个方法会显示一个图像,但它不起作用Objective c 在Xcode上显示图像,objective-c,xcode,Objective C,Xcode,我是xcode的初学者,我想制作一个项目,其中我有一些按钮,当我触摸按钮时,一个方法会显示一个图像,但它不起作用 - (IBAction)button01:(id)sender { CGRect frame; frame.origin.x = 0; frame.origin.y = 0; frame.size = CGSizeMake(580, 325); UIImage *image = [UIImage imageNamed:@"lightBox
- (IBAction)button01:(id)sender
{
CGRect frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size = CGSizeMake(580, 325);
UIImage *image = [UIImage imageNamed:@"lightBox.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
imageView.frame = frame;
}
谁能帮帮我
谢谢 试着去做:
- (IBAction)button01:(id)sender
{
CGRect frame;
frame.origin.x = 0;
frame.origin.y = 0;
frame.size = CGSizeMake(580, 325);
UIImage *image = [UIImage imageNamed:@"lightBox.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:background];
[self.view addSubview:imageView];
bgView.frame = frame;
}
我将它添加为子视图,这样它就会出现。Vocêpode pressionar no botão que parece um“check”e deixar essa pergunta como“respondida”。-)选中的!去一个我们的网站,阿因达,瓦鲁佩拉斯迪卡斯!阿布拉索!