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 7793581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:32:01+00:00 2026-06-01T22:32:01+00:00

I m Creating a custom alertview With Background image and one button (to dismiss

  • 0

I m Creating a custom alertview With Background image and one button (to dismiss the alert view).But the button action is not calling

enter image description here

here is my code.

In .h file

UIAlertView *alert;

In .m file

alert = [[UIAlertView alloc] init];

            [alert setTitle:nil];
            [alert setMessage:nil];
            [alert setDelegate:self];


            UIImage *alertImage = [UIImage imageNamed:@"stopthegame.png"];
            UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage :alertImage];

            backgroundImageView.frame = CGRectMake(0, 0, 282, 160);

            backgroundImageView.contentMode = UIViewContentModeScaleToFill;

            [alert addSubview:backgroundImageView];




   UIButton *alertok = [UIButton buttonWithType:UIButtonTypeCustom];


            alertok.frame = CGRectMake(105, 110, 75,40);

            UIImage *buttonImageNormal = [UIImage imageNamed:@"yesorno.png"];
            UIImage *strechableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
            [alertok setBackgroundImage:strechableButtonImageNormal forState:UIControlStateNormal];
            UIImage *buttonImagePressed = [UIImage imageNamed:@"instructionok.png"];
            UIImage *strechableButtonImagePressed = [buttonImagePressed stretchableImageWithLeftCapWidth:12 topCapHeight:0];
            [alertok setBackgroundImage:strechableButtonImagePressed forState:UIControlStateHighlighted];

            [alertok setTitle:@"OK" forState:UIControlStateNormal];
            [alertok setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal ];


           [alert addSubview:alertok ]; 

[alertok addTarget:self action:@selector(buttonClicked:) forControlEvents:UIControlEventTouchUpInside];



 [alert show];

Here is the code to dismiss the alert

- (IBAction)buttonClicked:(id)sender
{

    [alert dismissWithClickedButtonIndex:0 animated:YES];

}

some one please help. Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 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-06-01T22:32:03+00:00Added an answer on June 1, 2026 at 10:32 pm

    Something like this you create in a custom subclass UIView and call it out when needed. https://github.com/FreeApple/CustomAlertView

    +(void)showCustomPop:(CustomAlertViewType)type inView:(UIView*)view WithTitle:(NSString    
    *)title Message:(NSString *)message  actionButtonTitle:(NSString*)actionTitle 
    action:(void*)sel cancelButtonTitle:(NSString *)cancelTitle;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m creating custom checkbox and radio button in pure css but they are
I'm creating custom table view cells, but result is incorrect. My code: - (UITableViewCell
I'm creating custom UINavigationItem with custom background image and title. The image is shown
I'm creating custom window title. I did it with requestWindowFeature and setFeatureInt but not
Jython is great for creating custom data structures on need basis, but how to
I am looking into creating custom keyboard for Android, but I would like to
I am creating custom images that I later convert to an image pyramid for
I use PopupWindow class for creating custom popup window. But when I add layout_margin
I tried creating custom security and policy as given here: http://download.oracle.com/docs/cd/E15523_01/relnotes.1111/e10132/owsm.htm#CIADFGGC when I run
i'm creating custom title for activity by disabling standard one and managing everything myself.

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.