UIRefreshControl 使用

iOS 原生控件UIRefreshControl实现下拉刷新 前言 hihi,勇敢的小伙伴儿们大家好,某些情况下,我们已经做好了刷新的操作,但调用的方式却不太理想,想改成下拉刷新,这时候不想导入MJRefresh这样大的第三方库,只想简单的实现一个下拉刷新的调用方式。该如何快速实现呢? UIRefreshControl了解一下? 这是个原生的下拉刷新的控件,ScrollView已经添加了refreshControl的属性,非常方便好用。 正文 UI... 阅读详情
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    [self.view addSubview:self.tableView];
    [self.tableView registerClass:[MyTableViewCell class] forCellReuseIdentifier:cellId];

UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
    refreshControl.tintColor = [UIColor grayColor];
    refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:@""];
    [refreshControl addTarget:self action:@selector(refreshAction) forControlEvents:UIControlEventValueChanged];
    self.tableView.refreshControl = refreshControl;

-(void)refreshAction {
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.tableView.refreshControl endRefreshing];
    });
}

ios 10之前只对UITableviewController使用,ios 10之后支持 UIScrollView 以及其子类,比如说 UICollectionView,UITableView。

【ios】refreshControl控件 本博文主要是对ios中refreshControl控件的一个介绍,以及记录,方便后续使用时候可以直接加载,这边ios开发主要使用语言Objective-C。在iOS中,refreshControl是一个用于下拉刷新的控件。它可以放置在UITableView或UICollectionView的顶部,在用户向下拖拽时触发刷新操作。 阅读详情

相关推荐

ios6 UIRefreshControl实现下拉刷新、上拉加载

模拟QQ空间移动客户端实现的iOS6 pull refresh data新特性,自己另外加上了上拉加载的功能,上拉为线下比较流行的滑动到底部最后一条后自动更新的方式,而不再支持以前的上拉到底部一定程度后释放加载,增强了用户的体验感觉.

UIRefreshControl用法

【官方头文件】 #import #import  #import  NS_CLASS_AVAILABLE_IOS(6_0) @interface UIRefreshControl : UIControl // refreshControl初始化 - (instancetype)init; // 刷新中得状态判断,只读属性

咚咚锵咚锵咚锵 1992

现代 AI Agent 编排技术全景(1)—— 分类体系与四大技术维度

本文介绍基于 LLM 的现代 Agent 分类体系与四大技术维度,形成能够刻画不同 Agent 产品架构特征的分类法

佚失的诗篇 232

iOS - UIRefreshControl 刷新数据


 前言 NS_CLASS_AVAILABLE_IOS(6_0) __TVOS_PROHIBITED @interface UIRefreshControl : UIControl 1、UIRefreshControl UITableViewController 自带刷新控件。 使用 StoryBoard 创建的表格视图控制器可在 SB 的 TableVie...

rstbfveradsvc 242

用户画像标签维度_搭建电商平台用户画像标签体系

01 整体思路电商平台连接了卖家和买家两端,最终目的都是促进交易,从而追求更高的销售额。提高人货匹配度是促进交易的关键,而提高人货匹配度的关键就是“让买家找到想要的货物”。本文结合“人、货、场”理论模型,尝试建立电商平台的用户画像标签体系。02 三类标签用户在平台购物的整体流程可以概括为:进入平台、选择商品、下单付款。可以将该过程抽象为“人、货、场”。即用户通过什么途径进入什么商品的页面...

weixin_31668621的博客 1641

DESeq2实战:利用LRT检验解析时间序列基因表达动态变化

本文详细介绍了如何使用DESeq2中的LRT检验分析时间序列基因表达数据,揭示基因表达动态变化模式。通过构建完整模型与简化模型比较,LRT检验能有效识别处理效应随时间变化的基因,适用于发育过程、疾病进展等研究。文章提供了从数据准备、模型构建到结果可视化的完整实战指南,并分享了高级技巧与常见问题排查方法。

weixin_29062671的博客 439

iOS:自定义下拉刷新视图和下拉刷新原理

首先自定义一个UIRefreshControl名字叫做NewRefreshControl,在UITableViewController中将它的refreshControl设置成自定义的refreshControl,并且为refreshControl添加监听事件.- (void)viewDidLoad { [super viewDidLoad]; self.refreshControl

Dr_Enhart的博客 1016

【GB28181】wvp-GB28181-pro++ZLMediaKit编译安装国标流媒体服务器教程(Windows平台)

本文基于ZMLMediaKit+WVP-PRO在windows平台进行编译部署GB28181平台,网上教程也比较多,都大同小异,实际操作过程中容易出错的地方也比较多:redis安装无密码,mysql安装后密码的修改以及wvp数据可的创建,配置文件侧修改,尤其是和端口相关的项,再就是运行服务时各种错误需要注意,常见的错误已经做了汇总,遇到问题大家不要怕,找到报错的地方查看定位即可。

废人一枚的博客 4477

UIRefreshControl使用总结

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34087301的博客 372

搭建问答系统

数据描述 import docx import jieba from gensim.models import Word2Vec import os import numpy as np import pickle as pk import warnings from copy import deepcopy warnings.filterwarnings("ignore") from mu...

微信号:RunsenLiu 1838

基于 Qt C++ 的战术通信终端

logMessage(QString("新客户端连接来自: %1:%2").arg(incomingTcpSocket->peerAddress().toString()).arg(incomingTcpSocket->peerPort()));logMessage(QString("服务器已启动,在 [%1]:%2 监听IPv6连接...").arg(ui->lineEditAddress->text()).arg(port));

寒寒豆豆软件公司的博客 77

iOS---UIRefreshControl的使用

UIRefreshControl的使用非常简单。 1、使用范围 如果你装了xcode_4.5_developer_preview,那么在UITableViewController.h文件中你会看到,UITableViewController里面有如下声明,说明UITableViewController已经内置了UIRefreshControl控件

Mr.xiaoma.wen 1005

C#实现将DataGridView中数据导出到Excel (附完整源码)

C#实现将DataGridView中数据导出到Excel (附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 1588

没有UITableViewController的UIRefreshControl

Just curious, as it doesn't immediately seem possible, but is there a sneaky way to leverage the ne

p15097962069的博客 144

ASP.NET Core 6 Web API在IIS上的部署与调试

通过以上步骤和配置,你应该能够成功部署并调试你的ASP.NET Core 6 Web API在IIS上。记住,权限和配置是关键,确保你的环境和应用程序代码都正确设置。希望这篇博客对你部署和解决IIS上的问题有所帮助。

m0_74337424的博客 522

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

UITableView上的iOS UIRefreshControl

In this tutorial, we’ll be implementing UIRefreshControl on the UITableView in our iOS Application. You must have seen very often a spinning wheel when you pull the top of your screen in your iOS Appl...

从零开始的教程世界 441

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

UIRefreshControl刷新

a. UIRefreshControl /*  iOS6之后  1.创建一个UIRefreshControl 对象 (可以不设置大小和坐标)  2.设置UIRefreshControl 对象 属性 增加 事件(下拉到一定程度松手就会触发事件)  3.粘贴到要刷新的tableView上  4. 实现增加事件触发的方法 (在这个方法内进行刷新数据)  5.数据下载完之后要 停止刷新  

shuju345的博客 991

深度学习工具包 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")

UIRefreshControl的使用

注意: 1、需要在ios6.0之后的版本中使用 2、UIRefreshControl目前只能用于UITableViewController,如果用在其他ViewController中,运行时会错误(即UIRefreshControl只能被UITableViewController管理) UIRefreshControl类如下所示,东西不多 NS_CLASS_AVAILABLE_I...

weixin_30455365的博客 82

UIRefreshControl 下拉刷新

用惯了MJRefresh, EGOTableViewRefresh, 最近项目用UIRefreshControl尝试了下下拉刷新,也挺好的。。 @interface DeviceHomePageViewController () @property (strong, nonatomic) UITableView *myTableView; @property (stron

xuejunrong的博客 445

iOS UIRefreshControl使用详解

iOS UIRefreshControl使用详解 简介:         UIRefreshControl是iOS6自带的UITableView下拉刷新控件。 iOS6中,UITableViewController已经内置了UIRefreshControl控件。UIRefreshControl目前只能用于UITableViewController,如果用在其他ViewController

人不风流枉少年 7104

iOS 下拉刷新 UIRefreshControl

iOS开发过程中 可能会遇到下拉刷新的问题 今天我们演示一下下拉刷新的效果 首先 新建项目 起名 TestRefreshControl UIRefreshControl 只在UITableView上起作用 我们直接在默认生成的ViewController中新建TableView  同时创建一个 UIRefreshControl @interface V

1814

UIRefreshControl

  UIRefreshControl的使用 分类: ios开发2013-01-26 15:18 8539人阅读 评论(2) 收藏 举报   转自http://www.devdiv.com/iOS_iPhone-iOS6%E6%96%B0%E7%89%B9%E5%BE%81%EF%BC%9AUIRefreshControl_%E4%B8%8B%E6%8B%89%E5%88%B7%E6...

weixin_34279579的博客 86
上一篇: ios 模糊搜索支持首字母搜索、拼音搜索、汉字搜索
下一篇: [self.tableView reloadData] 刷新数据的时候视图会闪一下
TY_IOS
博客等级 码龄11年 16粉丝 34原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值