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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:54:06+00:00 2026-05-13T06:54:06+00:00

What I Want: A border indicating if a UIButton is selected or not. Background:

  • 0

What I Want: A border indicating if a UIButton is selected or not.

Background: I’ve got some UIButtons using transparent images, not text. These are toggle buttons (i.e. can be on or off).

Problem: The UIButton class gives users no indication of whether a button is selected or not unless you change something else about the button. Since the image doesn’t change with the state, I’d need two of every image, one normal, one selected and set one for each state of the button. This is annoying. I thought instead I’d change the background image, but this removes the pretty border on the button, I just get a rectangle of my background image, yuck.

Possible solutions I don’t like:

1) Create a background that matches the UIButton border and use that for selected. I don’t like this because they wont match perfectly and I’m picky.

2) Create two images for each button, essentially identical but with a different background. This seems like unnecessary work, and since this problem is coming up repeatedly, I want a solution for the future as well.

I hope somebody’s figured out a decent solution to this by now. Thanks in advance.

  • 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-13T06:54:06+00:00Added an answer on May 13, 2026 at 6:54 am

    Since UIButton has two image layers, an image and a background image, I think you could accomplish what you want by using just two background images for all your buttons. One image shows a border and the other does not. Swap the backgrounds out when the control state changed.

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

Sidebar

Related Questions

I want to show a border type look for an element but without using
All I want is a one pixel black border around my white UILabel text.
When a user focus a text field, I want the border, which is 1px,
I want the border to turn green when the mouse is over it and
Essentially I want a border-less, black window which I can set the location and
I want overlap the border-bottom of <span> above the border-bottom of <h1> . In
I want to use rounded border in my site. So, I use the CSS
I want to use rounded border in IE7. I use moz-border-radius property in Firefox.Like
I want to have a window with the border radius of the content border
I want to remove the last right border in a row of links? #mainMenu

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.