求助文档

2016-09-12  本文已影响134人  客观开发者

这种效果是怎么实现的呢?'


```

vocabulary_nested_scroll.setOnScrollChangeListener(newNestedScrollView.OnScrollChangeListener() {

@Override

public voidonScrollChange(NestedScrollView v,intscrollX,intscrollY,intoldScrollX,intoldScrollY) {

//firstVisibleItem--处于顶部的Item标记

//visibleItemCount--当前可见item数

//totalItemCount----总item数

//                Log.d("dmdrs", "滑动距离:" + getScrollY());

final intScrollY = v.getScrollY();

intnavHeight =50;

intnavWidth =video_text.getWidth();

//                int CGFloat = 40;

if(ScrollY >0&& ScrollY <200){

LinearLayout.LayoutParams linearParams =  (LinearLayout.LayoutParams)video_text.getLayoutParams();

linearParams.height=440- (navHeight + navHeight * ScrollY / (navWidth - navHeight - navHeight) - navHeight) - ScrollY;

video_text.setLayoutParams(linearParams);

//                    self.player.mPlayer.view.frame = CGRectMake(0, 0, ScreenW, 220 - (navHeight + navHeight * offset_Y / (self.ScreenW - navHeight - navHeight) - navHeight) - offset_Y)

}

```

这样写一卡顿。

上一篇 下一篇

猜你喜欢

热点阅读