繁体   English   中英

单击按钮时,图像将显示锁定屏幕预览和主屏幕预览

[英]on button click image will show lock screen preview and home screen preview

我有一个照相馆,还有一个动作表。 图片来自滚动视图上的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];

当您要调用预览时,请在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];
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM