Programming in almost language

This is the site where you may share your knowledge and experience to eachother..

  • Categories

  • LinkedIn

  • Tweet Me

  • My footsteps

UIColor with String

Posted by Praveen Kumar on February 1, 2011

Here, we have a variable called buttonColor which may have any string with color name, for instance “blue”,”black”,”red” and we are going to set the UIButton title color based on buttonColor given


SEL colorSel = NSSelectorFromString([NSString stringWithFormat:@"%@Color", buttonColor]);
UIColor* tColor = nil;
if ([UIColor respondsToSelector:colorSel]){
tColor  = [UIColor performSelector:colorSel];
} else {
tColor = whiteColor;
}
[button setTitleColor:tColor forState:UIControlStateNormal];

Posted in iPhone | Tagged: , , | Leave a Comment »

Disable the zoom effect on UIWebView

Posted by Praveen Kumar on December 11, 2010

Just paste the following line to your html under the HEAD tag

<“meta name = “viewport” content = “user-scalable = no”>

 

Regards,
Praveen

Posted in iPhone | Tagged: | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.