您的位置:首页 > 移动开发 > IOS开发

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];

项目需要,记住上次位置,没有的话(初始化),使用默认位置,可以来点动画呦。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: