- 浏览: 216496 次
- 性别:
- 来自: 上海
文章分类
最新评论
-
15197442045:
求demo,谢谢
IOS 后台执行代码(voip socket) -
15197442045:
我用了你这种方式,还是不能后台运行~~~~~
IOS 后台执行代码(voip socket) -
wlpych:
这个m_socket,从哪获得啊,什么方法?用的pjsip。求 ...
IOS 后台执行代码(voip socket)
DataTable = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
[DataTable setDelegate:self];
[DataTable setDataSource:self];
[self.view addSubview:DataTable];
[DataTable release];
二、UITableView各Method说
//Section总数
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return TitleData;
}
// Section Titles
//每个section显示的标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return @"";
}
//指定有多少个分区(Section),默认为1
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 4;
}
//指定每个分区中有多少行,默认为1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
}
//绘制Cell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:
SimpleTableIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier: SimpleTableIdentifier] autorelease];
}
cell.imageView.image=image;//未选cell时的图片
cell.imageView.highlightedImage=highlightImage;//选中cell后的图片
cell.text=//.....
return cell;
}
//行缩进
-(NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath{
NSUInteger row = [indexPath row];
return row;
}
//改变行的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return 40;
}
//定位
[TopicsTable setContentOffset:CGPointMake(0, promiseNum * 44 + Chapter * 20)];
//返回当前所选cell
NSIndexPath *ip = [NSIndexPath indexPathForRow:row inSection:section];
[TopicsTable selectRowAtIndexPath:ip animated:YES scrollPosition:UITableViewScrollPositionNone];
[tableView setSeparatorStyle:UITableViewCellSelectionStyleNone];
//选中Cell响应事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
[tableView deselectRowAtIndexPath:indexPath animated:YES];//选中后的反显颜色即刻消失
}
//判断选中的行(阻止选中第一行)
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger row = [indexPath row];
if (row == 0)
return nil;
return indexPath;
}
//划动cell是否出现del按钮
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
}
//编辑状态
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
[topicsTable setContentSize:CGSizeMake(0,controller.promiseNum * 44)];
//右侧添加一个索引表
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{
}
//返回Section标题内容
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
}
//自定义划动时del按钮内容
- (NSString *)tableView:(UITableView *)tableView
titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
//跳到指的row or section
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionBottom animated:NO];
三、在UITableViewCell上建立UILable多行显示
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
UILabel *Datalabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 320, 44)];
[Datalabel setTag:100];
Datalabel.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:Datalabel];
[Datalabel release];
}
UILabel *Datalabel = (UILabel *)[cell.contentView viewWithTag:100];
[Datalabel setFont:[UIFont boldSystemFontOfSize:18]];
Datalabel.text = [data.DataArray objectAtIndex:indexPath.row];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
//选中cell时的颜色
typedef enum {
UITableViewCellSelectionStyleNone,
UITableViewCellSelectionStyleBlue,
UITableViewCellSelectionStyleGray
} UITableViewCellSelectionStyle
//cell右边按钮格式
typedef enum {
UITableViewCellAccessoryNone, // don't show any accessory view
UITableViewCellAccessoryDisclosureIndicator, // regular chevron. doesn't track
UITableViewCellAccessoryDetailDisclosureButton, // blue button w/ chevron. tracks
UITableViewCellAccessoryCheckmark // checkmark. doesn't track
} UITableViewCellAccessoryType
//是否加换行线
typedef enum {
UITableViewCellSeparatorStyleNone,
UITableViewCellSeparatorStyleSingleLine
} UITableViewCellSeparatorStyle
//改变换行线颜色lyttzx.com
tableView.separatorColor = [UIColor blueColor];
发表评论
-
UIWebView清空缓存
2016-07-25 10:03 467- (void)clearAllUIWebViewData { ... -
iOS显示FPS值的工具FHHFPSIndicator
2016-07-04 13:56 0转载:http://www.cocoachina.com/io ... -
响应者链及相关机制总结
2016-06-30 14:25 465转载:http://www.cocoachina.com/i ... -
KVO&KVC的再次认知
2015-02-02 16:01 652KVO模型中,有两种通知观察者的方式,自动通知和手动通知。顾名 ... -
代码重构的理解(持续更新)
2015-01-13 17:27 550代码重构的理解和思考。 1:何时进行重构?当重复出现的时候,你 ... -
深入浅出Cocoa之Framework(转)
2015-01-06 17:49 0Framework 简介 转自 http://www.coc ... -
iOS静态库和动态库
2014-12-24 17:55 757一、什么是库? 库是共 ... -
svg图片在ios上的使用
2014-12-23 15:22 6391:从UI设计师那里得到的是每个svg图通过网站icomoon ... -
svg图片在ios上的使用
2014-12-23 15:22 31891:从UI设计师那里得到的是每个svg图通过网站icomoon ... -
Xcode设置项之Architectures和Valid Architectures
2014-12-22 10:42 581本文所讲的内容都是围绕iPhone的CPU指令集,现在先说说不 ... -
Xcode中Build Settings更改编译后能发现的问题
2014-12-17 13:36 6861:for循环不加括号 2:枚举赋值时类型不匹配 3:for循 ... -
静态库编译心得
2014-12-16 11:16 478我们编译静态库时一般会生成模拟器,真机两个包的.a文件 这二个 ... -
xcode编译选项整理
2014-12-11 19:15 0LINK_WITH_STANDARD_LIBRARIES = ... -
根据dsym解析crash_log
2014-12-01 14:15 8561:拷贝symbolicatecrash到/bin目录下 su ... -
autolayout心得
2014-10-28 13:30 638一:实现方案在以前就已经确定了下面几个点: 1 使 ... -
Objective-C的消息传递机制[转]
2014-07-31 20:34 582一直想写一篇类似的。 直接转载了 http://www.cnb ... -
iOS开发模拟限速
2012-12-07 17:47 53341. 模拟器网速调整: 限制时输入下面两行,根据需要修改下面的 ... -
iphone中结束电话后返回自己的应用(转载)
2012-04-10 10:30 1158iphone中结束电话后返回自己的应用 大家想不想在 ... -
Info.plist中常用的key简介(转载)
2012-03-15 15:55 901UIRequiresPersistentWiFi 在程序中弹出 ... -
UIScrollView 原理(转载)
2012-03-10 19:46 1113scroll view 原理 在滚动过程当中,其实是在修 ...
相关推荐
UITableView 详细讲解
【iphone应用开发】iphone应用开发之六:UITableView的详细讲解(一)
项目讲解地址:http://blog.csdn.net/yixiangboy/article/details/51009010。 代码请到github上下载,有更新:https://github.com/yixiangboy/YX_UITableView_IN_UITableView。 如果对你有用,star一下吧。
主要介绍了讲解iOS开发中UITableView列表设计的基本要点,其中对列表行操作的常用操作举例是iOS开发中经常用到的基础,需要的朋友可以参考下
主要介绍了iOS应用开发中使用UITableView创建自定义表格的方法,示例代码基于传统的Objective-C,需要的朋友可以参考下
主要介绍了iOS App中UITableView的创建与内容刷新,讲解了UITableView一些基本的样式与cell的设置及刷新,需要的朋友可以参考下
ExpandTableView 实现一个可以展开的 UITableView。 实现来自 Apple 的示例代码,但示例代码中混了诸多其他的代码(如手势展开某一 cell),所以我在此做一些简化以及注释。...详细的讲解在我 Blog,欢迎访问。
UITbableView作为列表展示信息,除了展示的功能,有时还会用到删除,排序等功能,下面就来讲解一下如何实现排序。 排序是当表格进入编辑状态后,在单元格的右侧会出现一个按钮,点击按钮,就可以拖动单元格,移动...
该文件完整的利用UITableView和UICollectionView实现仿QQ好友列表展开收起的效果,详细的代码逻辑实现和注释讲解
Case7:给UITableView加简单的视差视差效果标题 案例8:实时更改UITableViewCell的高度 案例9:等距视图 案例10:用约束优先级保证可移动View的内容可见性 案例11:Autolayout的约束=控件间位置关系的“绑定” 案例...
lazy懒加载(延迟加载)UITableView 举个例子,当我们在用网易新闻App时,看着那么多的新闻,并不是所有的都是我们感兴趣的,有的时候我们只是很快的滑过,想要快速的略过不喜欢的内容,但是只要滑动经过了,图片就开始加载了...
例如商品列表、聊天列表时,我们需要通过某种操作来刷新列表,最常用的便是下拉刷新的方法了,下拉刷新作为iOS的标准控件,即使不实用第三方库也可以容易的实现,这篇文章将向大家讲解如何使用UIRefreshControl实现...
内容 简单转场动画; ... 网络数据请求,分页,刷新绑定。 截屏 例子 Controller的实现: class JobController : ... rowHeight = UITableView. automaticDimension tableView. estimatedRowHeight = 150
Swift开发的QQ附近的人/探探/梯形卡片布局,UITableView式的使用,可以循环和加载更多,非常好用。Swift版本github地址:https://github.com/gsyhei/GXCardView-Swift,OC版本github地址...
本篇随便先讲解JSON解析。 正文: 关于JSON: JSON是一种轻量级的数据格式,一般用于数据交互JSON的格式很像Objective-C中的字典和数组:{“name”:”jack”,”age”:10} 补充: 标准的JSON格式的注意点:key必须...