100 likes | 264 Views
How to use UIActionSheet. 1 What’s the ActionSheet? 2 Syntax format: UIActionSheet *object name=[[UIActionSheet alloc]initWithTitle:@”NSString” delegate:nil cancelBttonTitle:@”NSString” destructiveButtonTitle:@”NSString” otherButtonTitles:nil];. How to use UIAlterView.
E N D
How to use UIActionSheet 1 What’s the ActionSheet? 2 Syntax format: UIActionSheet *object name=[[UIActionSheet alloc]initWithTitle:@”NSString” delegate:nil cancelBttonTitle:@”NSString” destructiveButtonTitle:@”NSString” otherButtonTitles:nil];
How to use UIAlterView 3 how to show the AlterView [object name showInView:self.view];
Some important code - (IBAction)actionSheet:(id)sender { UIActionSheet *sheet1=[[UIActionSheet alloc]initWithTitle:@"select button" delegate:self cancelButtonTitle:@"ok" destructiveButtonTitle:@"nothing" otherButtonTitles:@"aa",@"bb", nil]; [sheet1 showInView:self.view]; }
Some important code -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ NSString *cc=[actionSheet buttonTitleAtIndex:buttonIndex]; if ([cc isEqualToString:@"nothing"]) { text1.text=@"nothing"; }else if ([cc isEqualToString:@"aa"]){ text1.text=@"aa"; }else if ([cc isEqualToString:@"bb"]){ text1.text=@"bb"; }}
How to use UIImageView 1 What’s the ImageView? 2 Use initWithImage to create As Background: UIImageView *object name=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@”picture name”]]; self.view=object name;
How to use UIImageView 3 Use initWithFrame to create: UIImageView *object name=[[UIImageView alloc]initWithFrame:CGRectMake(80,150,150,200)]; object name.image=[UIImage imageNamed:@”picture name”]]; [self.view addSubView:object name];
How to use UIImageView 4 Use Center to create: object name.center=CGPointMake(CGFloat X,CGFloate Y);
How to use UIImageView 5 Use tranform to create: object name.tranform=CGAffineTransform MakeTranslation(CGFloat tx,CGFloate ty);
How to use UIImageView 6 Use tranform to create: object name.tranform=CGAffineTransform MakeRotation(CGFloat angle);