Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/113.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
Iphone 在按钮上单击图像将显示锁定屏幕预览和主屏幕预览_Iphone_Ios_Xcode - Fatal编程技术网

Iphone 在按钮上单击图像将显示锁定屏幕预览和主屏幕预览

Iphone 在按钮上单击图像将显示锁定屏幕预览和主屏幕预览,iphone,ios,xcode,Iphone,Ios,Xcode,我有一个照片库和一张行动单。图像来自滚动视图上的URL。所以,行动表中有两个按钮 1) 锁定屏幕预览和2)主屏幕预览 单击按钮,它将显示锁屏的外观,在主屏幕按钮上,它将看起来像主壁纸。 只是预览,不要设置它们。。 我不知道……请帮帮我……如果我知道你这么做: 创建PreviewViewController并在viewWillAppera委托中设置: UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,

我有一个照片库和一张行动单。图像来自滚动视图上的URL。所以,行动表中有两个按钮 1) 锁定屏幕预览和2)主屏幕预览 单击按钮,它将显示锁屏的外观,在主屏幕按钮上,它将看起来像主壁纸。 只是预览,不要设置它们。。
我不知道……请帮帮我……

如果我知道你这么做:

创建PreviewViewController并在viewWillAppera委托中设置:

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[imageView setImage:[UIImage imageNamed:@"image.png"]];
[self.view addSubview:imageView];
如果要调用preview,请在ActionSheet委托方法中使用此选项:

- (void) actionSheet:(UIActionSheet*) actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
    if(buttonIndex == 0) {
        [self presentViewController:preview animated:YES completion:nil];
    }
}
您还可以在PreviewViewController中添加“取消”按钮,并在单击时关闭视图:

-(IBAction)cancelButtonTaped:(id)sender {
    [self dismissModalViewControllerAnimated:YES];
}

这很简单。。你需要混合或使用两个图像一个接一个。。