How to open popup window contain UIview or image

12,036
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Popup Title" 
                                                message:@"This is pop up window/ Alert" 
                                               delegate:nil 
                                      cancelButtonTitle:@"OK"
                                      otherButtonTitles:nil];

UIImageView *tempImageView=[[UIImageView alloc]initWithFrame:CGRectMake(20,20,50,50)];

tempImageView.image=[UIImage imageNamed:@"abcd.png"];

[alert addSubview:tempImageView];

[alert show];
Share:
12,036
user2147631
Author by

user2147631

Updated on June 04, 2022

Comments

  • user2147631
    user2147631 almost 2 years

    i wants to open a popup window on click of buttons.Popup window should contain images or view at runtime. please help me. regards anupam

    • Petar
      Petar about 11 years
      You need to give more context...what kind of window ? How should it be displayed ? Have a look at presenting a modal view.
  • João Nunes
    João Nunes over 10 years
    doesn't work on iOS 7 SDK right?
  • BhushanVU
    BhushanVU over 10 years
    right..please refer these solutions for ios 7 stackoverflow.com/questions/18729220/…