Return to Snippet

Revision: 31701
at September 10, 2010 22:33 by BenClayton


Initial Code
UIButton* helpButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
UIImage* helpImage = [UIImage imageNamed:@"help.png"];
[helpButton setImage:helpImage forState:UIControlStateNormal];
[helpButton setImage:helpImage forState:UIControlStateHighlighted];
[helpButton setImage:helpImage forState:UIControlStateSelected];
helpButton.frame = CGRectMake(320 - 32 - 12, 480 - 32 - 12, 32, 32);
[self.view addSubview:helpButton];

Initial URL

                                

Initial Description

                                

Initial Title
Iphone: Programmatically adding a UIButton to a view

Initial Tags

                                

Initial Language
Objective C