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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:20:45+00:00 2026-06-15T21:20:45+00:00

How do I draw the title of a UIButton when subclassing it? I need

  • 0

How do I draw the title of a UIButton when subclassing it?
I need to subclass the UIButton class because of a custom drawRect method for drawing the button.

I believe that I have to draw the title inside the drawRect method, do I see that correctly?

  • 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-15T21:20:46+00:00Added an answer on June 15, 2026 at 9:20 pm

    It is better (and advised by Apple) not to subclass UIButton if you can. Most custom appearances can be achieved by setting a background image to a standard “custom” button. This way you still get the functionality of resizing, the label, the image etc. without needing to subclass. A button has a background image, an image and a title label – how and by what these components are drawn is not publicly available.

    If the image is derived at run time, you can still use the above technique, but draw in a new graphics context, extract the image and use that instead.

    If you really must use a drawRect method, I’d subclass UIControl rather than UIButton.

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

Sidebar

Related Questions

I have a form that I would like to draw a custom title bar
I draw an image in OnRender method of my custom FrameworkElement. I would like
I have a problem making an inner class that extends from JPanel to draw
I need to draw a circle to display the distance around a point that
Hey, Like in title can someone answer this simple question? I need draw line
I want to draw a custom NSWindow that allows me to add subviews even
I'm trying to draw an NSTextFieldCell subclass that looks like the rounded event item
As the title states, I'm trying to resize a Texture2D before even considering SpriteBatch.Draw()
Well, the title pretty much states it. I want to be able to draw
In this SO question I see the following: class MediaContent(models.Model): uploader = models.ForeignKey(User) title

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.