滚动视图上的悬浮控件

来源:互联网 发布:mac怎么浏览照片命名 编辑:程序博客网 时间:2024/05/04 09:23

myView = [[UIViewalloc] initWithFrame:CGRectMake(10,100, 150, 30)];

    myView.backgroundColor = [UIColorredColor];

    [self.tableViewaddSubview:myView];


-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

if(self.tableView.contentOffset.y > 100)

   myView.frame =CGRectMake(myView.frame.origin.x,self.tableView.contentOffset.y ,myView.frame.size.widthmyView.frame.size.height);

原创粉丝点击