View Full Version : UIButton font

Apr 29, 2009, 03:21 PM
How does one change the font and associated properties in a UIButton object?

Apr 29, 2009, 04:06 PM
There's a UIButton property "font"...

button.font = [UIFont....];
[button setFont:[UIFont...]];

You wouldn't have to wait as long for an answer by skimming through the UIButton docs :)

Apr 29, 2009, 07:09 PM
I did read the documentation. I had already tried both methods you suggest. The code complies and loads fine. Unfortunately, I get a black screen when the app tries to execute. If I comment out the button.font defintion, the app works fine.

I was looking for a working solution not a theoretical one.

Apr 29, 2009, 07:28 PM
Post your relevant code and we will be able to tell you what the problem is, if you want working solutions then provide details that people are able to work with!

Apr 29, 2009, 08:44 PM
Post your code, because before I give my posts, I always check with a new project in Xcode (to eliminate theory). So I know it's working at the bare minimum (a single button in the window).

Just because you comment out one line doesn't mean it's that specific line that's not working.

We'd be able to help you a lot better with your code. Preferrably your applicationdidfinish launching and the code where you create the button and add it to the view :).