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 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 a custom view with several NSTextField controls for which I want to
I have custom event that has several different subscribers who will all use the
I have several custom objects in an NSArray, I need to search through all
I have several custom View s in which I have created custom styleable attributes
I have several custom components which extends LinearLayout . Now I want to save/restore
I'm using a custom JLayeredPane. I have several Shapes which needed to be drawn
I have several custom datatypes in drupal 7 restaurant menu recipe chef i want
I have an event organizer where a user can create one or several custom
I have a WPF application which has a main window composed from several custom

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.