Java
Need help with TranslucentScrollView?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
yanjunhui2014

Description

android沉浸式状态栏+图片背景+标题栏渐变+背景伸缩

131 Stars 31 Forks 18 Commits 1 Opened issues

Services available

Need anything else?

TranslucentScrollView

效果如图: image

用法请参见 Demo

主要API

    //设置HeaderView(也就是拉伸区域)
    PullZoomView.setHeaderView(R.layout.view_header);
    //设置普通(追加)视图,可以添加多个
    PullZoomView.addNormalView(R.layout.view_normal, R.layout.view_normal);
    //设置阻力系数
    PullZoomView.setDamping(0.2f, 0);

//关联渐变视图 - 可选
PullZoomView.attachTransView(mActionBar, getResources().getColor(R.color.colorPrimary), -1, -1);
//设置透明度变化监听 - 可选
PullZoomView.setTranslucentChangedListener(new TranslucentScrollView.TranslucentChangedListener() {
      @Override
      public void onTranslucentChanged(int transAlpha) {
           //回调alpah值,0-255
      }
 });
 //隐藏ScrollBar - 可选
 PullZoomView.mLayoutTransSV.setVerticalScrollBarEnabled(false);

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.