Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 在Xcode上显示图像_Objective C_Xcode - Fatal编程技术网

Objective c 在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

我是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.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”。-)选中的!去一个我们的网站,阿因达,瓦鲁佩拉斯迪卡斯!阿布拉索!