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

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

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

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 06-11-2010, 02:55 PM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 2
glook.cl is on a distinguished road
Default Change Backgorund for all UIButton

how i can change centralized property backgorund for all uibutton in my app ¿?

Thanks.
glook.cl is offline   Reply With Quote
Old 06-11-2010, 04:05 PM   #2 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 107
JDave is on a distinguished road
Default one way to do this...

Try this in the method your button calls.

Code:
if ([self.view.subview isKindOfClass:[UIButton class]]) {
 //do something such as
 [[self.view.subview isKindOfClass:[UIButton class]] setText:@"testing"];
 //[[self.view.subview isKindOfClass:[UIButton class]] setBackgroundColor:[UIColor whiteColor]];
}
The above is dry code as I am not in front of my mac, but it should work once the syntax is corrected. It will change the text of all the UIButtons on screen to say testing. You will likely get a compiler "Warning" about not responding to setText, but that can be ignored...

you may be able to remove the if-statement if applicable...

Last edited by JDave; 06-11-2010 at 05:03 PM.
JDave is offline   Reply With Quote
Reply

Bookmarks

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: 368
7 members and 361 guests
.Snipe, AragornSG, baja_yu, davejas69, guusleijsten, hussain1982, Paul Slocum
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

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