星空网 > 软件开发 > 操作系统

【代码笔记】淡出淡入效果

一,效果图。

【代码笔记】淡出淡入效果images/loading.gif' data-original="http://images2015.cnblogs.com/blog/337518/201510/337518-20151014145913476-1430101902.jpg" width="218" height="400" />

二,工程图。

【代码笔记】淡出淡入效果

三,代码.

ViewController.h

#import <UIKit/UIKit.h>@interface ViewController : UIViewController@end

 

ViewController.m

【代码笔记】淡出淡入效果
#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (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, 200, 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];}- (void)didReceiveMemoryWarning {  [super didReceiveMemoryWarning];  // Dispose of any resources that can be recreated.}
【代码笔记】淡出淡入效果

 

 


 

原标题:【代码笔记】淡出淡入效果

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

寄包裹去泰国:https://www.goluckyvip.com/tag/103997.html
外国春节:https://www.goluckyvip.com/tag/104.html
Davids聊选品:https://www.goluckyvip.com/tag/1040.html
快递:https://www.goluckyvip.com/tag/10400.html
泰国回中国物流:https://www.goluckyvip.com/tag/104000.html
往泰国寄东西:https://www.goluckyvip.com/tag/104001.html
TikTok 将推出先买后付服务 :https://www.goluckyvip.com/news/188219.html
深圳有没有比较好玩的景点 深圳有没有比较好玩的景点推荐一下:https://www.vstour.cn/a/366175.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流