ios---setContentOffset
2015-08-13 22:35
423 查看
UIView * farmeView=[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
UITableView * conTentView=[[UITableView alloc] initWithFrame:CGRectMake(0, 110, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStyleGrouped ];
conTentView.dataSource=self;
conTentView.delegate = self;
conTentView.separatorStyle=UITableViewCellSeparatorStyleNone;
conTentView.backgroundColor=[UIColor whiteColor];
conTentView. sectionIndexTrackingBackgroundColor=[UIColor greenColor];
conTentView.tableHeaderView=[[UIView alloc] initWithFrame:CGRectMake(0, -10, 1, 1)];
_table=conTentView;
[conTentView setContentOffset:CGPointMake(0, 230) animated:YES];
[farmeView addSubview:conTentView];
[self.view addSubview:farmeView];
项目需要,记住上次位置,没有的话(初始化),使用默认位置,可以来点动画呦。
UITableView * conTentView=[[UITableView alloc] initWithFrame:CGRectMake(0, 110, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStyleGrouped ];
conTentView.dataSource=self;
conTentView.delegate = self;
conTentView.separatorStyle=UITableViewCellSeparatorStyleNone;
conTentView.backgroundColor=[UIColor whiteColor];
conTentView. sectionIndexTrackingBackgroundColor=[UIColor greenColor];
conTentView.tableHeaderView=[[UIView alloc] initWithFrame:CGRectMake(0, -10, 1, 1)];
_table=conTentView;
[conTentView setContentOffset:CGPointMake(0, 230) animated:YES];
[farmeView addSubview:conTentView];
[self.view addSubview:farmeView];
项目需要,记住上次位置,没有的话(初始化),使用默认位置,可以来点动画呦。
相关文章推荐
- iOS开发-Objc arrayWithCapacity: 深入分析
- iOS 基础知识 assign retain copy 和 nonatomic的用法
- 提高iOS开发效率
- iOS不同传值方法的分享
- 小白学开发(iOS)OC_ 字符串的获取 (2015-08-11)
- 小白学开发(iOS)OC_ Foundation之NSString类(2015-08-11)
- iOS开发 -- iPhone手机屏幕尺寸
- ios
- IOS开发—Quartz 2D介绍
- iOS 只取float类型值的小数点后两位
- iOS开发关于图片拉伸应用stretchableImageWithLeftCapWidth
- ios tableview didSelectRowAtIndexPath方法中,获取某个cell的实例
- 解决webrtc iOS 编译错误 Multiple codesigning问题
- coco2dx新建项目报错,ld: -pie can only be used when targeting iOS 4.2 or later clang: error: linker command
- IOS开发—截屏
- how to show provisionning profile information
- 重构iOS应用
- iOS音乐后台播放及锁屏信息显示
- iOS 集合的深复制与浅复制
- 苹果开发 笔记(60)文本字体、大小 、颜色、边框 设置