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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:32:56+00:00 2026-05-24T23:32:56+00:00

I’ve seen almost every question about similar issues, and tried the given answers, but

  • 0

I’ve seen almost every question about similar issues, and tried the given answers, but they are not working for me. The thing is: I have a home view, and I have a button, on click, it adds a new button and a label over it, and so on until you “fill” the area, and I want it to be resizable and scrollable, so you can see all the buttons and you can zoom-in to see just some buttons. I don’t know if I’m explaining myself clearly…

So, I tried adding everything to a UIView, and it didn’t work, I tried adding everything to a UIScrollView, and again it didn’t work. I don’t know what else to do. I’ve been dealing with this almost all week without any success. I have to say I am not very experienced on this, I just started to code for iOS about 4 months ago, so please be patient. I would really appreciate any help or guidance you can share.

Here’s what I am doing:

- (IBAction) doneAdding:(id) sender{
        boxes = boxes+1;
        UIButton *newBox = [UIButton buttonWithType:UIButtonTypeCustom];
        UIImage *boxImage = [UIImage imageNamed:@"bluecube.jpg"];

    if (boxes <= 4) {
    switch (boxes) {
        case 1:
            newBox.frame = CGRectMake(519, 356, 162, 163);
            break;
        case 2:
            newBox.frame = CGRectMake(681, 519, 162, 163);
            break;
        case 3:
            newBox.frame = CGRectMake(357, 519, 162, 163);
            break;
        case 4:
            newBox.frame = CGRectMake(519, 844, 162, 163);
            break;
            default:
            break;
    }

    [newBox setBackgroundImage:boxImage forState:UIControlStateNormal];
    [newBox addTarget:self action:@selector(goToProject:) forControlEvents:UIControlEventTouchUpInside];
    [homeView addSubview:newBox];


            //I get the text of the label from a textfield 
    UILabel *nameLabel= [ [UILabel alloc ] initWithFrame:CGRectMake(480.0,500.0, 150.0, 43.0) ];
    [[NSUserDefaults standardUserDefaults] setObject: newName.text forKey: @"SomeRandomText"];
    nameLabel.textAlignment =  UITextAlignmentCenter;
    nameLabel.textColor = [UIColor blackColor];
    nameLabel.backgroundColor = [UIColor clearColor];
    nameLabel.font = [UIFont fontWithName:@"Helvetica" size:(12.0)];
    nameLabel.text = [NSString stringWithFormat:@"%@", newName.text];
    [homeView addSubview:nameLabel];
    [newName release];


     }else {
        NSLog(@"No more boxes allowed");
     }
}
  • 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-24T23:32:56+00:00Added an answer on May 24, 2026 at 11:32 pm

    What do you mean with “it doesn’t work”? Did you try setting the UIScrollView‘s contentSize property to a size large enough to contain all the subview’s frames?

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

Sidebar

Related Questions

This could be a duplicate question, but I have no idea what search terms
I don't have much knowledge about the IPv6 protocol, so sorry if the question
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.