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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:17:01+00:00 2026-05-18T11:17:01+00:00

I have several custom uibuttons on my view. I want to create a toggle

  • 0

I have several custom uibuttons on my view. I want to create a toggle button which when pressed, it will loop through all the UIButtons and enable a background image for them.

What I have done is to use an image as a background, then created clickable parts of it using blank custom buttons. I want this toggle function to then show the buttons.

My plan is to create a subclassed UIButton for the “hidden” buttons. When the toggle button is pressed, the code should then set the background image for each of these buttons to a “reddot.png”. That stays on the screen until the toggle button is pressed again – this then disables each sub classed uibuttons background image.

What’s the best way to do this?

  • 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-18T11:17:02+00:00Added an answer on May 18, 2026 at 11:17 am

    I would advise you to not subclass UIButton for two reasons. First, UIButton is actually a class-cluster, which makes subclassing rather difficult. Secondly, I don’t think it is needed in your case.

    Simply create all the buttons as custom buttons. You can customize their appearance using methods like [button setHidden:] and [button setBackgroundImage:forState:]. The toggle button could then simply by linked to an IBAction, which would apply the appropriate customizations to the other buttons.

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

Sidebar

Related Questions

I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is
I have custom coded several enterprise applications for mid to large organizations to use
I have read several documentations about building custom ErrorHandler (by inheriting from IErrorHandler). Unfortunately,
I have a custom SharePoint page with several dataviews. The dataviews essentially filter documents
I have several custom web parts that I'm in the process of deploying to
I have several custom components in my uses list of a unit. For some
I have several custom functions that I use frequently in R. Rather than souce
I have a custom NSTableView subclass filled with several custom NSTextFieldCell subclasses. I would
I have a Visual Studio project with several Custom Build steps in it, but
I have a VGroup in my application that contains several custom components of type

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.