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

  • Home
  • SEARCH
  • 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 9024871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:07:59+00:00 2026-06-16T06:07:59+00:00

I have a UIImageView full screen, there are buttons above. These buttons, when pressed

  • 0

I have a UIImageView full screen, there are buttons above. These buttons, when pressed should open up a larger image that has buttons. A button to open a site and the other to close the image. I thought about using a layer to bring out the image, but nothing comes out, even if the button works.

  - (void)viewDidLoad
  {
       [super viewDidLoad];
        self.bigImageView= [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"SBS_visual_ok.jpg"]];
        self.bigImageView.frame = self.view.bounds;
        //....

        self.buttonInternational =[UIButton buttonWithType:UIButtonTypeRoundedRect];
        [self.buttonInternational addTarget:self action:@selector(pressedInternational:) forControlEvents:UIControlEventTouchUpInside];
        self.buttonInternational.frame = CGRectMake (100, 100, 100, 100);
        //...

        [self.view addSubview:self.bigImageView];
        [self.bigImageView addSubview:self.buttonInternational];
  }

pressing the button I want to get a picture with some buttons, but does not come out even the image. I have imported

  -(void)pressedInternational:(id)sender{

     CALayer *layer =[CALayer layer];
     layer.frame = CGRectMake(300, 400, 300, 200);
     layer.contents =(id)[UIImage imageNamed:@"International_Security_Service.png"].CGImage;

     [[self.bigImageView layer]addSublayer:layer]; 
     NSLog(@"The layer is %@", layer);
     //The layer is <CALayer: 0x757ba30>


   }

How do I put on a layer of buttons?

  • 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-16T06:08:00+00:00Added an answer on June 16, 2026 at 6:08 am

    Why are you trying to use a CALayer? It would probably be easier to display another UIView, which can have images, buttons, whatever:

    MyView *myView = [[MyView alloc] initWithFrame:CGRectMake(10.0, 10.0, 300.0, 300.0)];
    [self.view addSubview:myView];
    

    which you can easily show / hide

    [self.myView setHidden:YES];
    

    or push a new view controller:

    MyViewController *nextViewController = [[MyViewController alloc] init];
    [self presentViewController:myViewController animated:YES completion:nil];
    

    If necessary, you could apply animations to the display and removal of either of these.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIImageView showing a image that is larger than it's frame. It's
I have a UIImageView which has a png image sequence loaded into it. My
I have a UIImageView that starts off with an image (loading.png) specified in IB.
I have a custom UIImageView class that creates thumbnails (UIImageView) and each thumbnail has
I have a UIImageView that I need to animate off the screen. I'm doing
I have a ViewController with a full screen UIImageView. I've hidden statusBar and NavigationBar,
I have method that download and resize image according to screen size to fit
I have a UIImageView object that when clicked it will play a animation, I
I have two UIImageView objects inside my view (both 320x480 one above the other).
I have a UIImageView that is displaying a series of pictures as an animation.

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.