根据NestedScrollView的滑动来渐变显示Title。
nestedScrollView.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (nestedScrollView, i, i1, i2, i3) -> {int height = dp2Px(45, getContext());if (i1 <= 0) {tv_title.setText("教师资格证");tv_title.setAlpha(0);} else if (i1 > 0 && i1 < height) {tv_title.setText("教师资格证");//获取渐变率float scale = (float) i1 / height;//获取渐变数值float alpha = (1.0f * scale);tv_title.setAlpha(alpha);} else {tv_title.setAlpha(1f);}});