首页 > 移动平台 > 详细

iOS开发中在UIWebView中添加Gif动态图

时间:2015-08-10 13:23:18      阅读:204      评论:0      收藏:0      [点我收藏+]

开发是一件很有趣的事,偶尔在程序中添加一些小东西,会给你的应用增色不少。比如,当你的某些功能暂时还不准备上线时,可以先一个放展示Gif动态图的UIWebView上去,既可以告诉用户APP以后会有的功能,也会使你的APP手动可爱,打动一大波妹子。

 

#import "ViewController.h"

 

@interface ViewController ()

@property (weak, nonatomic) IBOutlet UIWebView *myWalletWebView;

@end

 

@implementation ViewController

 

- (void)viewDidLoad {

    [super viewDidLoad];

 

    [self initWithPictureAnimation];

}

 

-(void)initWithPictureAnimation{

    self.myWalletWebView.backgroundColor = [UIColor lightGrayColor];

    

    NSData *gif = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"myWallet" ofType:@"gif"]];

    

    self.myWalletWebView.userInteractionEnabled = NO;

    

    [self.myWalletWebView loadData:gif MIMEType:@"image/gif" textEncodingName:nil baseURL:nil];

    

    NSLog(@"hehe");

}

 

@end

 

 

iOS开发中在UIWebView中添加Gif动态图

原文:http://www.cnblogs.com/yyt-hehe-yyt/p/4717603.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!