Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6652867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:11:44+00:00 2026-05-26T01:11:44+00:00

Essentially I have a UIAlertView that pops up. When a user selects a button

  • 0

Essentially I have a UIAlertView that pops up. When a user selects a button it calls itself, and based on the button index it brings up a UIImageView subview. My question is, because the UIImageView takes up a good portion of the screen it lays on top of the UIAlertView, so the cancel button is unseen. I was wondering if I could create actions on the UIImageView so that if it is clicked or touched up inside, the UIAlertView/UIImageView would resign and disappear?

Someone please help, I’ve been tooling around this for hours.

Here is the code from the button being clicked, and the button index.

- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex     {
// the user clicked one of the OK/Cancel buttons
if (buttonIndex == 0)
{
 //     exit(0);
}
else
{
    UIAlertView *successAlert = [[UIAlertView alloc] initWithTitle:@"molecule" message:molURL delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];

    UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 280, 260)];


    NSString *MyURL = molURL;

    NSString *apURL = [NSString stringWithFormat:@"%@",MyURL];


    NSURL * imageURL = [NSURL URLWithString:apURL];
    NSData * imageData = [NSData dataWithContentsOfURL:imageURL];
    UIImage * image1 = [UIImage imageWithData:imageData];


    //UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path];
    [imageView setImage:image1];


    [successAlert addSubview:imageView];

    [successAlert show];
  }
}
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:11:44+00:00Added an answer on May 26, 2026 at 1:11 am

    MyImageView.h

    #import <UIKit/UIKit.h>
    
    @interface MyImageView : UIImageView {
    
    
    
    }
    
    @end
    

    MyImageView.m

    #import "MyImageView.h"
    
    
    @implementation MyImageView
    
    
    - (id)initWithFrame:(CGRect)frame {
    
        self = [super initWithFrame:frame];
        if (self) {
    
            self.userInteractionEnabled=YES;
    
        }
        return self;
    }
    
    
    -(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    
        [UIView animateWithDuration:2.0f animations:^(void) {
    
    
            self.alpha=0.0f;
    
            super.hidden =YES;
    
            UIAlertView *alert=(UIAlertView*)self.superview;
    
    
            alert.alpha=0.0f;
    
            [alert dismissWithClickedButtonIndex:0 animated:YES];
    
            //or
    
            //[alert removeFromSuperview];
    
        }];
    
    
    
    
    }
    
    
    - (void)dealloc {
        [super dealloc];
    }
    
    
    @end
    

    MyViewController.h

        @class MyImageView;
    

    MyViewController.m

        #import "MyImageView.h"
    

    then while create imageView

        MyImageView *specialImageView =[[MyImageView alloc]initWithFrame:CGRectMake(0, 0, 280, 260)];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have essentially a survey that is shown, and people answer questions a lot
I have a very large, spread out class that is essentially a very contrived
Apologies for the difficult title, but I essentially have a model Foo that has
In all my searching I see that you essentially have to copy the existing
Here is what I essentially have: I have thread A that periodically checks for
Essentially I have developed a C# Service that runs and uses the Enterprise Library
If you have to use String.Replace() to replace test 50 times, you essentially have
Essentially I have a method of a class called killProgram, which is intended to
I have essentially the same problem discussed here: http://khason.net/blog/dependency-property-getters-and-setters-in-multithreaded-environment/ public static readonly DependencyProperty MyPropertyProperty
I'm trying to build a Hibernate layer for a database schema I have essentially

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.