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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:44:58+00:00 2026-05-23T09:44:58+00:00

Good day fellow programmers, It has been hours now since I’ve tried resolving this

  • 0

Good day fellow programmers,

It has been hours now since I’ve tried resolving this problem. I am planning to create some kind of menu view the same to that of Facebook’s iOS app. The problem is, i can only add up to two UIButtons in the UIScrollView, the third and other consecutive buttons won’t show up. I hope you could help me with this.

Here is the code block:

- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBarHidden = NO;
for (int i = 0; i < colors.count; i++) {
    CGRect frame;
    frame.origin.x = self.scrollView.frame.size.width * i;
    frame.origin.y = 0;
    frame.size = self.scrollView.frame.size;

    UIView *subview = [[UIView alloc] initWithFrame:frame];

    if(i == 0)
    {

        UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];    //Creates a UIButton

        button.frame = CGRectMake(25, 65, 70, 70); //sets the coordinates and dimensions of UIButton

        button.backgroundColor = [UIColor clearColor]; //sets the background color

        [button addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; //sets the target and action for the button

        [button setBackgroundImage:[UIImage imageNamed:@"Message Board Icon-57.png"] forState:UIControlStateNormal]; //sets the background Image


        [subview addSubview:button];
        [button release];

        UIButton *button2 = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; //Creates a UIButton

        button2.frame = CGRectMake(125, 175, 70, 70); //sets the coordinates and dimensions of UIButton

        button2.backgroundColor = [UIColor clearColor]; //sets the background color

        [button2 addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; //sets the target and action for the button

        [button2 setBackgroundImage:[UIImage imageNamed:@"Profile Page Icon-57.png"] forState:UIControlStateNormal]; //sets the background Image

        [subview addSubview:button2];
        [button2 release];


        UIButton *button3 = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; //Creates a UIButton

        button3.frame = CGRectMake(125, 65, 70, 70); //sets the coordinates and dimensions of UIButton

        button3.backgroundColor = [UIColor clearColor]; //sets the background color

        [button3 addTarget:self action:nil forControlEvents:UIControlEventTouchUpInside]; //sets the target and action for the button

        [button3 setBackgroundImage:[UIImage imageNamed:@"iCalendar Icon-57.png"] forState:UIControlStateNormal]; //sets the background Image


        [subview addSubview:button3];
        [button3 release];


    } 
    [subview release];
}

self.scrollView.contentSize = CGSizeMake(self.scrollView.frame.size.width * colors.count, self.scrollView.frame.size.height);

}
  • 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-05-23T09:44:59+00:00Added an answer on May 23, 2026 at 9:44 am

    You have to add you UIView *subview to scrollView to show it up in that and also buttons. just do, [scrollView addSubview:subView];

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

Sidebar

Related Questions

Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to
Good day everyone, this is one of those areas that is a little over
Good day all, First of all, maybe i went about this the wrong way
Good day... I have huge trouble with this and it drives me insane. My
Good day, I need to extract portion of string which can looks like this:
Good day members, I have an input file which has rows of numerical digits
good day! I am having a problem on showing the updated version of my
Good day, I have a hibernate mapping which goes something like this <class name=Person>
Good day. I'd like to ask a question. Why TextBox control Txt in this
Good day! I've found this solution here: VS2010 Web Publish command line version of

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.