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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:25:17+00:00 2026-06-12T23:25:17+00:00

I used this question: How to create a UIButton with a black gradient for

  • 0

I used this question:

How to create a UIButton with a black gradient for iPhone?

… to set up a color gradient as the background of my button and it looks great, but when I tap the button it doesn’t visibly change and give the user any feedback that they successfully tapped the button.

How can I set up a second gradient for the highlighted state or something like that?

  • 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-12T23:25:18+00:00Added an answer on June 12, 2026 at 11:25 pm

    Well, you are setting a sublayer and not providing any content to the button’s views. The sublayers are drawn directly, so the UIButton doesn’t think it has any content to “highlight”. If you want a different effect on your button when you select it, there are three simple approaches.

    One is to make two images with gradients. A pressed and normal state. This is much simpler as you can design them as you want and its a simple one line, one time implementation.

    The other option is adding selectors that get called when your button gets UIControlEventTouchDown and whichever other Control Event(s) you want to have it switch back under.

    The last simple option is to subclass UIButton and use the UIResponder touch methods to determine when to manually switch between the different background types.

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

Sidebar

Related Questions

I used the mapping solution from this question to have a joined component. But
Forgive my ignorance in asking this basic question but I've become so used to
I'm sure this was asked somewhere in another question, but the wording used there
Hello i used of answer in this question : Create new class from a
I have used this question here on stackoverflow to create a random string without
This question has been asked before: AlertDialog custom title has black border But was
(This used to be a 2-part question, but since the second part is literally
I'm pretty sure that this question is very noob but I'm not used to
I've used this question as a template to solve the same problem, but I'm
I used the examples of this question to create drag-and-drop-script I could use on

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.