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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:19:34+00:00 2026-06-01T11:19:34+00:00

I have added a UIScrollVIew using IB. Then using the following code i add

  • 0

I have added a UIScrollVIew using IB. Then using the following code i add a few buttons to this UIScrollView.

for (int index=0; index<3;index++)
{
    UIButton* button=[UIButton buttonWithType:UIButtonTypeRoundedRect];

    [button setTitle:buttonTitle forState:UIControlStateNormal];
    [button setFrame:CGRectMake(18,200,300,45)];
    [button setTag:100+index];
    [button addTarget:self action:@selector(butclick:) forControlEvents:UIControlEventTouchUpInside];
    [self.scrollView addSubview:button];
}

Now i need a way to remove these buttons which i added from the ScrollView.

note: There are other buttons, images, labels attached to the UIScrollView. And those should not be removed. It’s only the buttons that i added programatically should get removed from the UIScrollView.

  • 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-01T11:19:35+00:00Added an answer on June 1, 2026 at 11:19 am

    Put a tag on those buttons, then you can take them again using:

    for (int index=0; index<3;index++)
    {
        UIButton *myButton = (UIButton *)[self.scrollView viewWithTag:100+i];
        [myButton removeFromSuperView];
    }
    

    Or save those buttons in an array, and then you can do the same.

    And if you just want to hide them, you can do:

    myButton.hidden = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add the UIButton to UIScrollView . I have added the
HI I have a UIScrollView In this scrollView i have added an UIImage ,UILabel,UIButton.
HI All. I have subclass of UIScrollView. IN this class I have added some
I have added some code which compiles cleanly and have just received this Windows
I have added multi-language using the short article below. When you add for example
Have added the following code to my SQL query: (Note cut down version) DECLARE
I have added some dynamic textboxes upon a button click. I need the values
I have added a RadControl, RadGrid and I need to add a radComboBox in
I have n number of UITextview and that are added to UIScrollview.and uiscrollview is
I have a UIScrollView containing a UIImageView. now I also added a two finger

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.