美文网首页
求助文档

求助文档

作者: 客观开发者 | 来源:发表于2016-09-12 12:04 被阅读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)

    }

    ```

    这样写一卡顿。

    相关文章

      网友评论

          本文标题:求助文档

          本文链接:https://www.haomeiwen.com/subject/fjeehttx.html