共有113篇文章,第2页,共6页
-
-
UITableview 单选和重用[博客]
- // 选中操作
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// 取消前一个选中的,就是单选啦
NSIndexPath *lastIndex = [NSIndexPath indexPathForRow:_index inSection:0];
UITableViewCell *...
-
-
UITableView cellForRowAtIndexPath 代理方法介绍[博客]
- // 构建tableView的单元格
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//必须用一个静态字符串
static NSString *cellIdentifier = @"cell";
// 判断是有空闲的cell,有进行重用,没...
-
-
UITableView 基本使用[二] 基本属性[博客]
- // 设置表视图的颜色
_tableView.backgroundColor = [UIColor yellowColor];
// 设置表视图的分割线的颜色
// _tableView.separatorColor = [UIColor purpleColor];
// 设置表视图的分割线的风格
_tableView.separatorStyle = UITableViewCellSep...
-
-
UITableView 基本使用[一][博客]
- 1、要使用UITableView必须用当前实现两个协议<UITableViewDataSource, UITableViewDelegate> UITableViewDataSource协议实现了数据加载的方法,UITableViewDelgate协议实现了UITableView外观设置,事件等方法。 // RootViewController.h 测试控制器
#import <UIKit/UIKi...
-
-
UITableView 详解 教程[博客]
- 看TableView的资料其实已经蛮久了,一直想写点儿东西,却总是因为各种原因拖延,今天晚上有时间静下心来记录一些最近学习的TableView的知识。下面进入正题,UITableView堪称UIKit里面最复杂的一个控件了,使用起来不算难,但是要用好并不容易。当使用的时候我们必须要考虑到...
-
-
uitableview中reloaddata cell中的label重叠显示而不是刷新显示 ...[博客]
- 使用带有identifier的cell,写一个UITableViewCell类,然后在该类中声明IBOutlet @property(nonatomic,strong) IBOutlet UILabel *timeLabel; 并在storyboard中连接。 在uitableview 中的cellForRowAtIndexPath方法中 static NSString *CellIdentifier = @"meetingCell"...
-
-
UITableView 添加长按手势UILongPressGestureRecognizer[博客]
- 给UITableView 添加长按手势,识别长按哪一行。 长按手势类UILongPressGestureRecognizer, 属性minimumPressDuration表示最短长按的时间 添加手势代码: UILongPressGestureRecognizer * longPressGr = [[UILongPressGestureRecognizer alloc] initWithT...
-
-
UITableView reloadData的正确方法。[博客]
- 相信很多人会遇到这种情况,当tableView正在滚动的时候,如果reloadData,偶尔发生App crash的情况。 这种情况有时候有,有时候没有,已经难倒了很多人。直至今天,我在stackoverflow上面,仍没有发现真正有说到其本质的帖子。我的处女贴,选择这个问题来阐述一下我的观点。...
-
-
UITableView设置一些属性[博客]
- 设置背景为透明: setBackgroundColor:[UIColor clearColor] cell设置没有分割线 setSeparatorStyle:UITableViewCellSeparatorStyleNone
-
-
IOS——简化表格单元的生成[博客]
- 通过继承UITableViewCell简化表格单元的生成:代码如下 XYCustomCell.h #import <UIKit/UIKit.h>
@interface XYCustomCell : UITableViewCell
+ (id)cellForTableView:(UITableView *)tableView;
+ (NSString *)cellIndentifier;
- (id)initWithCellIdentifie...
-
-
UITableView的重用机制[博客]
- 查看UITableView的头文件,会找到NSMutableArray * visiableCells, 和 NSMutableDictionary * reusableTableCells两个结构体。visiableCells内保存当前显示的cells,reusableTableCells保存可重用的cells。 TableView显示之初,reusableT...
-
-
iOS 之 UITableView 使用索引[博客]
- 在开发app中,经常会使用到UITableView,今天无聊做了一个demo,UITableView显示索引。 显示索引实现的委托方法主要是: //返回section的个数 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView //返回索引数组 -(NSArray *)sectionIndexTitles...
-
-
在iOS中使用tableView[博客]
- UITableView是iOS中最常用的控件了,所以使用起来也很简单。 ViewContoller.h 文件 (继承UITableViewDelegate&UITableViewDataSource协议): //
// ViewController.h
// ViewController
//
// Created by monkey mot on 13-6-20.
// Copyright (c) 2013年 monk...
-
-
EGORefreshTableHeaderView引入错误[博客]
- 1, 在使用下拉刷新类库EGORefreshTableHeaderView的时候,将资源文件添加到工程中,但是忘记假如QuartzCore.framework框架,造成编译错误: Undefined symbols for architecture i386: "_CATransform3DMakeRotation", referenced from: -[EGORefreshTableHea...
-
-
IOS iPhone 开发 UItableView中的单元格背景渐变[博客]
- IOS iPhone 开发 UItableView中的单元格背景渐变 渐变如果用背景图片,会让你的app臃肿。给APP瘦身,我们可以使用代码来解决渐变的问题。这篇文章是解决表格中的单元格的简便问题,同时解决单元格外边框问题。 1:设置好开始颜色与结束颜色。推荐一个小工具,在chrome浏览器...
-
-
iOS之UITableView重新排序[博客]
- 表格视图在ios 开发中,经常使用到的视图,几乎每个app 中多多少少都会有UITableView的影子,就是因为UITableView的功能非常强大,使用起来也非常简单,苹果公司也对接口做了很好的封装,才使用ios程序员这么喜欢它。使用表格视图相关的类UITableViewController,UITab...
-
-
IOS TableView Cell重用机制及TableView[博客]
- IOS TableView Cell重用机制及TableView常用Code2013-03-28 10:36:47 我来说两句 作者:lianbaixue 收藏 我要投稿 创建UITableViewController子类的实例后,IDE生成的代码中有如下段落: [cpp] view plaincopy - (UITableViewCell *)tableVie...
-
-
UITableViewCell的---accessoryType属性[博客]
- cell.accessoryType = UITableViewCellAccessoryNone;//cell没有任何的样式
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;//cell的右边有一个小箭头,距离右边有十几像素;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton...
-
-
如何获取tableView:viewForHeaderInSection:方法返回的UIView[提问]
- tableView:cellForRowAtIndexPath: 方法返回的UITableViewCell可以通过 [tabView cellForRowAtIndexPath:indexPath] 方法来获取,那 tableView:viewForHeaderInSection: 方法返回的UIView通过tabView怎么获取呢?...
-
-
ios6.0 tableview中取到的headview是null[提问]
- for (int i = 0 ; i < product_num.count; i++) {
UIView *view = [myTableview headerViewForSection:i];
NSLog(@"%@",[myTableview headerViewForSection:i]);//这里打印出来是 null
for (UIView *v in view.subviews) {
if ...