UIAlertView 之上的 UIView

发布于 2024-11-24 01:59:53 字数 403 浏览 0 评论 0原文

我有一个 UIAlertView,它有一个按钮。通过按下该按钮,我需要在 UIAlertView 上方加载相机控制器(图像选择器)。在 ImagePicker 中按取消将返回到上一个视图的 UIAlertView。

非常感谢任何帮助。提前致谢。

{

    UIButton *aStartTimer = [[UIButton alloc]initWithFrame:CGRectMake(90, 170, 45, 45)];
    [aStartTimer setImage:[UIImage imageNamed:@"timer.png"] forState:UIControlStateNormal];

    [alertView addSubview:aStartTimer];
}

提前致谢

I have an UIAlertView which has an Button. By pressing that button I need to load a Camera controller(Image Picker) above the UIAlertView. Pressing cancel in ImagePicker will go back to UIAlertView of Previous view.

Any Help is Greatly appreciated. Thanks in Advance.

{

    UIButton *aStartTimer = [[UIButton alloc]initWithFrame:CGRectMake(90, 170, 45, 45)];
    [aStartTimer setImage:[UIImage imageNamed:@"timer.png"] forState:UIControlStateNormal];

    [alertView addSubview:aStartTimer];
}

Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瞎闹 2024-12-01 01:59:53
        UIAlertView * alertAddImage = [[UIAlertView alloc] init];
        [alertAddImage setDelegate:self];
        [alertAddImage setTitle:@"Add Images"];

        [alertAddImage addButtonWithTitle:@"Take a New Picture"];
        [alertAddImage addButtonWithTitle:@"Cancel"];
        [alertAddImage setNeedsLayout];
        [alertAddImage show];
        [alertAddImage release];

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
    [self imageFromCamera];
}

-(void)imageFromCamera{
 imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
 [self presentModalViewController:imgPicker animated:YES];
}
        UIAlertView * alertAddImage = [[UIAlertView alloc] init];
        [alertAddImage setDelegate:self];
        [alertAddImage setTitle:@"Add Images"];

        [alertAddImage addButtonWithTitle:@"Take a New Picture"];
        [alertAddImage addButtonWithTitle:@"Cancel"];
        [alertAddImage setNeedsLayout];
        [alertAddImage show];
        [alertAddImage release];

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0)
    [self imageFromCamera];
}

-(void)imageFromCamera{
 imgPicker.sourceType = UIImagePickerControllerSourceTypeCamera;
 [self presentModalViewController:imgPicker animated:YES];
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文