标题栏透明
作者:
Il_mondo | 来源:发表于
2018-07-05 18:01 被阅读18次final View view = findViewById(R.id.fixation_title_bar); // 需要透明的view
final View totalTitle = findViewById(R.id.total_title);
CompatNestedScrollView scrollView = findViewById(R.id.scrollView);
scrollView.setOnScrollChangedListener(new CompatNestedScrollView.OnScrollChangedListener() {
@Override
public void onScrollChanged(NestedScrollView scrollView, int x, int y, int oldx, int oldy) {
float totalTitleHeight = totalTitle.getHeight(); // 目标高度
float alphaValue = y / totalTitleHeight;
view.setAlpha(alphaValue);
}
});
本文标题:标题栏透明
本文链接:https://www.haomeiwen.com/subject/eqzpuftx.html
网友评论