`
caoyudong
  • 浏览: 25538 次
  • 性别: Icon_minigender_1
  • 来自: 扬州
社区版块
存档分类
最新评论

滑动scrowview 上方菜单选项的下环线随着移动 效果

阅读更多
UIView:
-(id)initWithFrame:(CGRect)frameid)targetSEL)sel
{
    self=[super initWithFrame:frame];
    if (self)
    {
        scrow.delegate=target;
        m_showBar=[[ShowBar alloc]initWithFrame:CGRectMake(15, 28, 70, 2)];
        [self addSubview:m_showBar];

    }
    return self;
}

-(void)setShowBarPointCGPoint)barPoint
{
    m_showBar.frame=CGRectMake(15+barPoint.x/3+3, 28, 70, 2);
}


UIViewController:
- (void)viewDidLoad
{
//第一次启动实例化uiview
}

-(void)scrollViewDidScroll:(UIScrollView *)scrollView  //uiscrowView代理方法
//offset changes
{
    CGPoint rec=scrowView.scrow.contentOffset; //得到scrow的实时动态contentOffSet坐标
    [scrowView setShowBarPoint:rec];
}
0
4
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics