当前位置: 首页 > news >正文

网站入口设计规范wordpress导航改哪个php文件

网站入口设计规范,wordpress导航改哪个php文件,wordpress适合做官网,海外网络推广在iOS开发中使用最为常见的是UITableView#xff0c;其中UITabelViewCell中下载图片#xff0c;会影响用户下拉刷新UI,导致卡顿#xff0c;用户体验不好#xff0c;在这篇blog中#xff0c;我将以一个例子来说明如何优化UITableView下载图片 1.使用懒加载方式#xff0c…在iOS开发中使用最为常见的是UITableView其中UITabelViewCell中下载图片会影响用户下拉刷新UI,导致卡顿用户体验不好在这篇blog中我将以一个例子来说明如何优化UITableView下载图片 1.使用懒加载方式首先将CellData数据加载进来 // lazy - (NSMutableArray*)apps { if (!_apps) { NSString *path [[NSBundle mainBundle]pathForResource:”apps.plist” ofType:nil]; NSArray *dictArray [NSArray arrayWithContentsOfFile:path]; NSMutableArray *appArray [NSMutableArray array];for (NSDictionary *dict in dictArray) {App *app [App appWithDict:dict];[appArray addObject:app];}_apps appArray; } return _apps;} 2.然后在UITaleView的dataSource方法中加载数据 //Table view data source - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.apps.count; } - (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *ID ”app”; UITableViewCell *cell [tableView dequeueReusableCellWithIdentifier:ID forIndexPath:indexPath]; if (!cell) {cell [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID]; } App *app self.apps[indexPath.row]; cell.textLabel.text app.name; cell.detailTextLabel.text app.download;UIImage *image self.images[app.icon]; if (image) {cell.imageView.image image; } else {cell.imageView.image [UIImage imageNamed:placeholder];// 下载图片[self download:app.icon indexPath:indexPath]; }return cell;} (1)其中在加载图片过程中首先判断图片是否已经下载过如果下载过直接加载如果没有下载过那么就需要下载并且需要填写一个默认的图片 其中判断图片是否已经下载过是使用字典查询的 - (NSMutableDictionary *)images { if (!_images) { _images [[NSMutableDictionary alloc]init]; } return _images; } 下载图片,是需要创建一个线程来执行下载首先应该判断是否下载线程已经执行如果执行不需要重复下载因此这个线程也是与一个imageURL来绑定 (void)download:(NSString )imageUrl indexPath:(NSIndexPath )indexPath { NSBlockOperation *operation self.operations[imageUrl]; // 如果存在操作则直接返回防止已经在下载的操作重复下载 if (operation) { return; } __weak typeof (self) appsVc self; operation [NSBlockOperation blockOperationWithBlock:^{ NSURL *url [NSURL URLWithString:imageUrl]; NSData *data [NSData dataWithContentsOfURL:url]; UIImage *image [UIImage imageWithData:data]; [[NSOperationQueue mainQueue] addOperationWithBlock:^{if (image) {appsVc.images[imageUrl] image;}[appsVc.operations removeObjectForKey:imageUrl];[appsVc.tableView reloadRowsAtIndexPaths:[indexPath] withRowAnimation:UITableViewRowAnimationNone]; }];}]; [self.queue addOperation:operation]; self.operations[imageUrl] operation; } 为进一步优化应在用户滑动过程中停止下载结束拖拽时候开始下载 /** * 当用户开始拖拽表格时调用 */ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { // 暂停下载 [self.queue setSuspended:YES]; } /** * 当用户停止拖拽表格时调用 */ - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate { // 恢复下载 [self.queue setSuspended:NO]; }
http://www.yutouwan.com/news/83717/

相关文章:

  • 专业做蛋糕的网站网站运营岗位介绍
  • 关于网站建设的工作总结网站项目建设的组织机构
  • asp.net建立网站吗营销型网站有哪些建设流程
  • 珠海商城网站把百度网址大全设为首页
  • 网站开发招聘名称公司做网站 优帮云
  • wordpress图片站优化成品软件网站大全推荐
  • 网站建设考试题目郑州官方网站建设首选华苏科技
  • php网站源码架构抚顺网站建设
  • 自己做网站需要什么材料手机网站有什么要求
  • 建立一个自己的网站上海网站建设公司网站建设
  • 员工支付做网站的费用分录做网站公司价格
  • 网站认证打的钱怎么做分录公司装修会计分录
  • 衡州网站建设seo做外贸找生意上哪个网站
  • 手机设计logo软件长春网站优化教程
  • wordpress站内优化网站域名申请流程
  • 创意网站模板下载wordpress编辑媒体永久链接
  • 坦洲网站建设投资公司经营范围
  • 长沙专业的建站按效果付费wordpress后台编辑主题时提示:抱歉_该文件无法被编辑
  • 南通设计网站建设想要学做网站
  • 福州营销网站建设技术产品开发项目管理全流程
  • 谁会在阿里云建网站M97 网站建设网络公司整站源码
  • 网站建设开发感悟做破解网站合法
  • 河南省住房城乡和建设厅网站南通市城乡和住房建设局网站
  • 赞叹天河网站建设公司重庆工程建设标准化信息网
  • 网站建设合同规范室内设计师的网站
  • 织梦网站后台空白怎么建设境外网站
  • 东营市两学一做考试网站网站前端工程师
  • asp网站镜像代码wordpress+手册主题
  • 企业建设网站作用wordpress主题雪人yeti1.9.2
  • 我是做网站怎么赚钱吗福建宏盛建设集团网站