- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //UIView UIView *v ...
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. //UIView UIView *view=[[UIView alloc]initWithFrame:CGRectMake(10, 100, 100, 200)]; view.backgroundColor=[UIColor redColor]; [self.view addSubview:view]; //淡出 //[self fadeOut:view]; //淡入 //[self fadeIn:view]; }//淡出-(void) fadeOut:(UIView *)view{ CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.3]; [view setAlpha:0.0f]; [UIView commitAnimations];}//淡入-(void) fadeIn:(UIView *)view{ CGContextRef context = UIGraphicsGetCurrentContext(); [UIView beginAnimations:nil context:context]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:0.3]; [view setAlpha:1.0f]; [UIView commitAnimations];}
海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com
原标题:淡出淡入
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。