0
我正在制作应用程序,在其中选择一个按钮,然后将其引导至图库以选择图片。我希望所选图片成为按钮的主要图像。 任何人都可以帮助我吗?将按钮图像设置为从xcode库中选择的图像
这里是我用来达到进库代码:
- (IBAction)image1Pressed:(id)sender {
if([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary])
{
UIImagePickerController *picker1= [[UIImagePickerController alloc]init];
picker1.delegate = self;
picker1.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentViewController:picker1 animated:YES completion:nil];
[picker1 release];
}
}
任何帮助将不胜感激!
感谢
我还需要保持IBAction * image1Pressed连接吗? – parisianastro97 2013-04-11 18:08:35