Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-18-2010, 12:15 AM   #1 (permalink)
Registered Member
 
Join Date: Feb 2010
Posts: 4
Default Highlighting Round Rect Button(UIButton)

I have the following code snippet:

@interface Foo: UIViewController {
...
UIButton *myButton;
...
}

@implementation Foo

- (void) viewDidLoad {
...
myButton.highlighted = YES;
...
}

This is a very simple button - no images.

When I run the app, the button is highlighted in blue (default behavior). It works as I expected.

The problem is that when I click on the button once, the highlight (in blue) is gone. I debug it by hard-coding "myButton.highlighted = YES;" on one of my (IBAction). It does not work anymore.

How can I keep it highlighted in blue even after being pressed?

Thanks in advance for your help
pion is offline   Reply With Quote
Old 02-23-2010, 07:49 AM   #2 (permalink)
Registered Member
 
Join Date: Dec 2009
Posts: 97
Question

I have exactly the same problem. I would like the button to stay highlighted when being clicked. Please help!

EDIT: I did a workaround by setting a background image for the selected state. This works fine but when the button is pressed there is a climpse of the normalhighlight before the background image is set. Can the short highlight for pressing a button be deactivated?

Last edited by SteveMobs; 02-23-2010 at 08:40 AM.
SteveMobs is offline   Reply With Quote
Reply

Bookmarks

Tags
uibutton

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 260
23 members and 237 guests
ADY, bookesp, chillyh, ckgni, dacapo, Dani77, DarkAn, Davey555, Desert Diva, glenn_sayers, HemiMG, jakerocheleau, JasonR, LEARN2MAKE, nobre84, prchn4christ, Raggou, Rudy, ryantcb, Speed, themathminister, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:38 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0