iOS经典讲解之实现上拉刷新和下拉刷新

【PVCodeNet】《Palm Vein Recognition Network Combining Transformer and CNN》 1]吴凯,沈文忠,贾丁丁,等.融合Transformer和CNN的手掌静脉识别网络[J].计算机工程与应用,2023,59(24):98-109. 阅读详情


在iOS开发中,我们经常要用到下拉刷新和上拉刷新来加载新的数据,当前这也适合分页。iOS原生就带有该方法,下面就iOS自带的下拉刷新方法来简单操作。

上拉刷新

1、在TableView里,一打开软件,我们就调用下拉刷新事件。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- ( void )viewDidLoad {
     [ super viewDidLoad];
 
     // 集成刷新控件
     [ self setupRefresh];
     
}
 
/**
  *  集成下拉刷新
  */
-( void )setupRefresh
{
     //1.添加刷新控件
     UIRefreshControl *control=[[UIRefreshControl alloc]init];
     [control addTarget: self action: @selector (refreshStateChange:) forControlEvents:UIControlEventValueChanged];
     [ self .tableView addSubview:control];
     
     //2.马上进入刷新状态,并不会触发UIControlEventValueChanged事件
     [control beginRefreshing];
     
     // 3.加载数据
     [ self refreshStateChange:control];
}

2、接下来,我们就要实现 refreshStateChange 这个方法,在里面显示数据和关闭下拉刷新。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
  *  UIRefreshControl进入刷新状态:加载最新的数据
  */
-( void )refreshStateChange:(UIRefreshControl *)control
{
     // 3.发送请求
     AFHTTPRequestOperationManager *mgr = [AFHTTPRequestOperationManager manager];
     
     [mgr GET:@ "https://api.weibo.com/2/statuses/public_timeline.json" parameters: nil success:^(AFHTTPRequestOperation *operation, NSDictionary *responseObject){
         
         //1.获取数据,处理数据,传递数据给tableView,如:
         
         // 将最新的微博数据,添加到总数组的最前面
//        NSRange range = NSMakeRange(0, newStatuses.count);
//        NSIndexSet *set = [NSIndexSet indexSetWithIndexesInRange:range];
//        [self.statuses insertObjects:newStatuses atIndexes:set];
         
         //2.刷新表格
         [ self .tableView reloadData];
         
         // 3. 结束刷新
         [control endRefreshing];
         
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
 
         // 结束刷新刷新 ,为了避免网络加载失败,一直显示刷新状态的错误
         [control endRefreshing];
     }];
}

上拉刷新 

上拉刷新,一般用于分页请求,拉到底后,自动加载下一页。下面就拿加载新浪微博数据为例。

一、由于下载加载更多数据,是一个不变的布局控件,我们就用xib来实现。

HWLoadMoreFooter.h

1
2
3
4
5
#import <UIKit/UIKit.h>
 
@interface HWLoadMoreFooter : UIView
+(instancetype)footer;
@end

HWLoadMoreFooter.m

1
2
3
4
5
6
7
8
9
10
#import "HWLoadMoreFooter.h"
 
@implementation HWLoadMoreFooter
 
+(instancetype)footer
{
     return [[[ NSBundle mainBundle] loadNibNamed:@ "HWLoadMoreFooter" owner: nil options: nil ] lastObject];
}
 
@end

接着,我们建立一个名为HWLoadMoreFooter的xib

接下来,需要设置下面三个地方:

接着在框里拖拉一个Label,设置Label为填充整个view

最后,点击下图红色框,Update Frames

xib建好之后,下面我们来实现上拉刷新的代码

二.实现代码。

1.在TabelView中加载时,先加载该控件

1
2
3
4
5
6
7
8
9
10
- ( void )viewDidLoad {
     [ super viewDidLoad];
     
     // 集成下拉刷新控件
     [ self setupUpRefresh];
     
     // 集成上拉刷新控件
     [ self setupDownRefresh];
     
}

 2.集成上拉刷新方法

1
2
3
4
5
6
7
8
9
/**
  *  集成上拉刷新
  */
-( void )setupDownRefresh
{
     HWLoadMoreFooter *footer = [HWLoadMoreFooter footer];
     footer.hidden = YES ;
     self .tableView.tableFooterView = footer;
}

 3.异步请求数据方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
- ( void )loadMoreStatus
{
     // 1.请求管理者
     AFHTTPRequestOperationManager *mgr = [AFHTTPRequestOperationManager manager];
     
     // 2.拼接请求参数
     HWAccount *account = [HWAccountTool account];
     NSMutableDictionary *params = [ NSMutableDictionary dictionary];
     params[@ "access_token" ] = account.access_token;
     
     // 取出最后面的微博(最新的微博,ID最大的微博)
     HWStatus *lastStatus = [ self .statuses lastObject];
     if (lastStatus) {
         // 若指定此参数,则返回ID小于或等于max_id的微博,默认为0。
         // id这种数据一般都是比较大的,一般转成整数的话,最好是long long类型
         long long maxId = lastStatus.idstr.longLongValue - 1;
         params[@ "max_id" ] = @(maxId);
     }
     
     // 3.发送请求
     [mgr GET:@ "https://api.weibo.com/2/statuses/friends_timeline.json" parameters:params success:^(AFHTTPRequestOperation *operation, NSDictionary *responseObject) {
         // 将 "微博字典"数组 转为 "微博模型"数组
         NSArray *newStatuses = [HWStatus objectArrayWithKeyValuesArray:responseObject[@ "statuses" ]];
         
         // 将更多的微博数据,添加到总数组的最后面
         [ self .statuses addObjectsFromArray:newStatuses];
         
         // 刷新表格
         [ self .tableView reloadData];
         
         // 结束刷新(隐藏footer)
         self .tableView.tableFooterView.hidden = YES ;
     } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
         HWLog(@ "请求失败-%@" , error);
         
         // 结束刷新
         self .tableView.tableFooterView.hidden = YES ;
     }];
}

 4.实现scrollViewDidScroll

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
- ( void )scrollViewDidScroll:(UIScrollView *)scrollView
{
     //    scrollView == self.tableView == self.view
     // 如果tableView还没有数据,就直接返回
     if ( self .statuses.count == 0 || self .tableView.tableFooterView.isHidden == NO ) return ;
     
     CGFloat offsetY = scrollView.contentOffset.y;
     
     // 当最后一个cell完全显示在眼前时,contentOffset的y值
     CGFloat judgeOffsetY = scrollView.contentSize.height + scrollView.contentInset.bottom - scrollView.height - self .tableView.tableFooterView.height;
     if (offsetY >= judgeOffsetY) { // 最后一个cell完全进入视野范围内
         // 显示footer
         self .tableView.tableFooterView.hidden = NO ;
         
         // 加载更多的微博数据
         [ self loadMoreStatus];
     }
}

跟着团子学SAP CO:基于成本的完工百分比结算:Cost-based POC(以项目为例) 本文以英国及北美会计准则下的基于成本的POC的销售型项目结算对PS模块中的完工百分比进行介绍 阅读详情

相关推荐

c++2048小游戏编写

最近编写了一个小游戏,叫作2048,用到了面向对象的知识。

一个学生的博客 2372

iOS下拉刷新和上拉刷新

在iOS开发中,我们经常要用到下拉刷新和上拉刷新来加载新的数据,当前这也适合分页。iOS原生就带有该方法,下面就iOS自带的下拉刷新方法来简单操作。 上拉刷新 1、在TableView里,一打开软件,我们就调用下拉刷新事件。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2...

weixin_30414245的博客 225

CEH Practical 实战考试真题与答案

CEH Practical 是 EC-Council 推出的Certified Ethical Hacker(CEH)认证项目中的一项高级动手实践考试。它不同于传统的理论考试,侧重于在真实环境中检验考生的实操能力。

sgafdgdagd的博客 968

下拉或上拉刷新 -- 苹果自带 和 第三方库

完成刷新有两种方式:1):使用苹果自带的控件  UIRefreshControl                  2):使用第三方框架  EGOTableViewPullRefresh a:使用苹果自带控件 --  UIRefreshControl   原理:该控件是继承自contorl的,所以直接添加响应事件即可。-- 事件为,值改变  UIControlEventVa

转身扭到脖子的专栏 776

【中文OCR】中文字符图片的分割方法

最近想做一个关于中文OCR的小系列,也是对之前做的东西的一个总结。作为这个系列的第一篇,我觉得还是有必要说一下关于中文字符图片分割的问题。因为现在开源的OCR代码比较多,相对而言对字符图片的分割的方法提的比较少,尤其是中文字符图片的分割还是有一定困难在里面的。 一、普遍使用的切割方法 现在大部分开源项目上用切割方法还是基于水平、垂直投影字符切割方法。 原理比较简单容易理解,也比较容易实现。先...

zhangzm0128 1万+

Rstudio-server无法登陆?几种解决方法 卡死 崩溃了 卡住

Q6:Rstudio-server无法登陆?几种解决方法1 检查登陆方式是否正确 (IP/域名 端口是否弄错了)2 查看自己用户名和密码是否输入错误(大部分无法登陆的原因都是第1点和第2点)3清空浏览器cookie缓存,或者换个浏览器登陆,推荐谷歌浏览器4 如果是出现下面截图界面,试试点击Terminate R 或 Safe Mode(如果试了还不行,继续尝试后面方法5~8)5 ssh登录,然后查看自己的磁盘存储空间是否用尽(方法见Q9),如果是,先清理自己的磁盘空间。

生信小博士的博客 1万+

iOS自定义下拉刷新控件

iOS自定义下拉刷新控件

xo19882011的专栏 1040

【农业生产系统模型】基于R语言APSIM模型进阶应用与参数优化、批量模拟实践技术

APSIM模型有Classic和Next Generation两个系列模型,能模拟几十种农作物、牧草和树木的土壤-植物-大气过程,被广泛应用于精细农业、水肥管理、气候变化、粮食安全、土壤碳周转、环境影响、农业可持续性、农业生态等诸多与农业生产和科研有关的领域。R语言是一门应用场景广泛、简单易学的程序语言,APSIM模型开发了许多R语言辅助包,在APSIM模型的气候、土壤、管理措施等数据准备,自动化模拟,参数优化和结果分析上都发挥着重要的作用。案例一:APSIM模型输入参数和土壤文件的制备。

2303_79243743的博客 1046

iOS开发-自定义下拉刷新控件PullDownRefreshView

iOS开发-自定义下拉刷新控件PullDownRefreshView在开发过程中,有时候需要自定义下拉刷新控件,这时候我们就需要自定义PullDownRefreshView。PullDownRefreshView是在UIScrollView上。

一名开发者 612

【STM32-DSP库的使用】基于Keil5 + STM32CubeMX + CMSIS-DSP 手动添加、库添加方式

CMSIS-DSP库在工程中应用遇到的所有问题进行归纳终结

洋洋的博客 1万+

利用Matlab绘制非线性系统相图:从理论到实践

本文详细介绍了如何利用Matlab进行非线性系统的相图绘制与相平面分析。从理论基础的状态空间转换出发,通过无阻尼线性谐振子和范德波尔振荡器等实例,手把手演示了使用ode45求解器绘制相图、分析平衡点与极限环的完整流程,并分享了方向场绘制、参数分岔探索及常见错误解决方案等高级技巧,为动力学系统分析与控制设计提供了直观强大的可视化工具。

yhn456789的博客 907

iOS开发-Lottie实现下拉刷新动画效果

iOS开发-Lottie实现下拉刷新动画效果在开发过程中,有时候需要自定义下拉刷新控件,这里使用Lottie实现下拉刷新动画效果。

一名开发者 2274

【测开求职】面试题:计算机网络 详细版整理

本篇文章是笔者为准备研究生复试和校招而写,因此主要针对问答,注重理解,而不在于细节计算。读者可以先查看上面的链接走一遍计算机网络的整体框架结构。其中,重点难点以及易混淆的知识点,笔者会用其他文章进行了详述,在知识点处贴好了链接,有需要的可以查阅。

vector的博客 5936

iOS 上下拉刷新 MJRefresh

MJRefresh - github @[toc] 1.判断是上拉还是下拉 var isPullDown = true if refreshHeader.isRefreshing { isPullDown = true } else { isPullDown = false }

baidu_40537062的博客 1108

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

IOS MJRefresh:下拉刷新与上拉加载

文章目录MJRefresh简介举例1.准备2、添加相关属性3、初始化4.实现UITableView数据源方法5、实现下拉刷新与上拉加载代码 MJRefresh简介 MJRefresh用于为应用添加常用的上拉加载更多与下拉刷新效果,适用UIScrollView、UITableView 、 UICollectionView、UIWebView控件。它的类结构如下. 图中红色文字的类,我们可以直接拿来...

煮酒Shae 3004

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

iOS中的下拉刷新SVPullToRefresh

下拉刷新是一种利用手势刷新用户界面的功能,虽然已经被Twitter申请为专利,但依然不能阻止广大的App开发者在自己的应用中加入该功能。苹果公司甚至在iOS6的sdk中加入了UIRefreshControl,从而实现了系统级的下拉刷新。但是UIRefreshControl是绑定在UITableViewController上的,所以灵活性不高。 如果在网上搜下拉刷新的实现,讨论最多的恐怕是EGOT

iTenric的专栏 1万+

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

BitCPM4-CANN-0.5B实战教程:在华为昇腾平台上部署量化大语言模型

欢迎来到**BitCPM4-CANN-0.5B实战教程**!🎉 本文将为你详细介绍如何在华为昇腾平台上部署这款创新的1.58位(三元)量化大语言模型。BitCPM4-CANN-0.5B是OpenBMB开源社区推出的首个原生支持华为Ascend NPU的端到端1.58位大语言模型训练系统,为AI部署带来了革命性的内存优化方案。 ## 为什么选择BitCPM4-CANN-0.5B?🚀 **Bi

gitblog_00038的博客 548

Laravel Permission与队列系统集成:异步权限处理的10个实战技巧 [特殊字符]

在现代化的Laravel应用中,**Laravel Permission** 权限管理包是管理用户角色和权限的终极解决方案。然而,当应用规模扩大、用户量增长时,同步处理权限操作可能会导致性能瓶颈。本文将为您展示如何通过 **队列系统集成** 实现异步权限处理,提升应用性能和用户体验!✨ [![Laravel Permission 社交卡片](https://raw.gitcode.com/gh_

gitblog_00862的博客 837

iOS-自定义下拉刷新上拉加载(可根据自己的需求改)

1.前言       我们在iOS开发的过程中,下拉刷新上拉加载可以说必须用到,而大家经常用到的就是MJRefresh,封装的简单好用,被很多开发者青睐。但是我们在开发APP的时候,有些产品汪或者BOSS想展现APP自己的风格,需要定制自己的APP,所以我在这里封装了一个ZFJRefresh,大家可以根据自己的需求修改ZFJRefresh,这里面不是很复杂,就只把headview和footVie

ZFJ_张福杰 2836

iOS学习之路--下拉刷新和上拉加载更多

iOS学习之路--下拉刷新和上拉加载更多 简介 本文中笔者将和大家分享应用app中常用到的表单内容的下拉刷新和上拉加载更多的功能实现的方法。 内容 1.有哪些实现方法与各方法的优劣 使用过美团,大众点评的朋友们应该有注意到,当你向上滑动表单的时候会有更多的店铺加载进你的表单中,而当你下滑表单顶的时候,则会刷新表单的内容并从网络上获取最新的信息。通过下拉刷...

weixin_30823683的博客 188

IOS6新特性之下拉刷新<UIRefreshControl>

在IOS6未发布之前,几乎都是使用那个UIRefresh在实现下拉刷新,甚至有人还是先了上拉的功能,不得不说牛人很多啊。可能是Apple意识到了这个功能的实用性,在IOS6中增加了下拉刷新,但是上啦还没有添加。新手自学了一下这个下拉刷新的功能,还不错,分享一下。 首先看一下最终的效果:         注:我使用的是IOS6 SDK  + xCode4.5 一、新建一个工程,基

8045

推荐一款惊艳视觉体验的iOS下拉刷新组件: AJWaveRefresh

推荐一款惊艳视觉体验的iOS下拉刷新组件: AJWaveRefresh 项目介绍 在移动应用开发中,下拉刷新功能已成为提升用户体验不可或缺的一部分。今天向大家推荐的是一个名为 AJWaveRefresh 的iOS开源组件。它不仅提供了一种标准的下拉刷新方式,更重要的是带来了一场视觉盛宴——以流畅的贝塞尔路径描绘出动态波浪效果,为单调的下拉刷新动作增添了无限趣味与美感。 技术分析 核心技术点 基于...

gitblog_00084的博客 515

ios 下拉刷新

最近工作涉及到了下拉刷新的功能,贴出来,跟大家一起分享,我把RefreshView代码上传~~ 1,添加RefreshView到tableView     NSArray *nils = [[NSBundlemainBundle]loadNibNamed:@"RefreshView"owner:selfoptions:nil];     self.refreshView = [nil

黑菜妞妞的专栏 840

JoyMapperSilicon 项目教程

JoyMapperSilicon 项目教程 1. 项目的目录结构及介绍 JoyMapperSilicon 项目的目录结构如下: JoyMapperSilicon/ ├── JoyKeyMapper.xcworkspace ├── JoyKeyMapper ├── JoyKeyMapperLauncher ├── JoyMapperSilicon.xcodeproj ├── lang │ └──...

gitblog_00814的博客 397

iOS开发 下拉刷新上拉加载更多详解

下拉刷新(上拉加载更多)是大家经常用到的功能,本篇文章将带大家详细介绍下拉刷新原理,一步步实现下拉刷新效果。下拉刷新的核心原理是先自定义一个refreshView,然后将自定义的view添加到tableView(collectionView上)监听tableView(或者collectionView)的contentOffset属性,根据偏移量动态修改refreshView的子控件即可。下面一步步

MrZhao的博客 873

iOS 开发:上拉加载,下拉刷新

iOS 开发:上拉加载,下拉刷新 本讲内容: /* 1.数据加载中的提示视图(菊花图); 2.数据的下拉加载; 3.数据的上拉刷新; */ 注:本讲内容需要两个第三方类包,提示视图需要:MBProgressHUD包;刷新加载需要:MJRefresh/MJRefresh-master包,分别对应ARC与MRC,当然也可以混合使用,只需-fobjc-arc; 1.数据加载中的提

Dongxk的博客 1883
上一篇: iOS经典讲解之实现App消息推送功能(二)
下一篇: iOS经典讲解之清除缓存文件
刘新林
博客等级 码龄11年 72粉丝 61原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值