UIActionSheet

UIActionSheet *actns;

actns=[[UIActionSheet alloc]initWithTitle:@”select image” delegate:self cancelButtonTitle:@”cancle” destructiveButtonTitle:@”kinfo” otherButtonTitles:@”dance”,@”couple”,@”freedom”, nil];

[actns showInView:self.view];

– (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex

{
switch (buttonIndex) {

case 0:

self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@”kinfo.jpg”]];

break;

case 1:

self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@”dance.jpg”]];

break; case 2:

self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@”couple.jpg”]];

break; case 3:

self.view.backgroundColor=[UIColor colorWithPatternImage:[UIImage imageNamed:@”freedom.jpg”]];

break;

case 4:
self.view.backgroundColor=[UIColor whiteColor];

break; default:

break; }

Leave a comment