/ Published in: Objective C

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (void)viewDidLoad { contentView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; [contentView setImage:[UIImage imageNamed:@"284.jpg"]]; [contentView setUserInteractionEnabled:YES]; self.view = contentView; [contentView release]; UIButton *startButton = [[UIButton alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 180.0f, 130.0f)]; [startButton setBackgroundImage:[[UIImage imageNamed:@"squareButton.png"] stretchableImageWithLeftCapWidth:110.0 topCapHeight:0.0] forState:UIControlStateNormal]; [startButton setCenter:CGPointMake(195.0f, 208.0f)]; [startButton addTarget:self action:@selector(playSound:) forControlEvents:UIControlEventTouchUpInside]; [contentView addSubview:startButton]; [super viewDidLoad]; }
URL: http://pointlessprogrammers.com/?p=100
Comments
