1

嗨,我正在尝试通过单击按钮打开图像,在我.h

@interface FirstDetailViewController : UIViewController {
    IBOutlet UIButton *premi;
    IBOutlet UIImageView *figura;

    UIButton *apri;
}

@property (nonatomic, retain) IBOutlet UIButton *apri;

@end

在我的.m档案中

@implementation FirstDetailViewController


- (IBAction)apri:(id)sender {


}

我必须使用哪个代码?非常感谢您

4

1 回答 1

2

您还需要包含- (IBAction)apri:(id)sender;在您的.h中。

就按钮使用而言,您的逻辑是正确的,您将premiapri:Interface Builder 中连接。

至于“打开”图像,有很多方法可以处理图像。您可以使用指定的图像加载 UIImageView,或使用 UIWebView,或许多其他方式。

于 2011-01-19T18:45:44.153 回答