android滚动并查看whatsup等详细信息

时间:2015-06-10 13:45:03

标签: android android-scrollview whatsapp

放置一些像向下箭头的图标,以便用户可以知道下面的android中显示了一些细节。

enter image description here

滚动页面结束后,滚动箭头将消失。

1 个答案:

答案 0 :(得分:0)

 scrollView1.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {

         public void onScrollChanged() {

           int scrollViewHeight = scrollView1.getChildAt(0).getHeight();


           Log.e("scrollVIEW_height", "SCROLL" + scrollViewHeight);

           double size = 0;

           DisplayMetrics dm = mContext.getResources().getDisplayMetrics();

           float screenWidth = dm.widthPixels / dm.xdpi;

           float screenHeight = dm.heightPixels / dm.ydpi;

           float i = dm.heightPixels;

           Log.e("height in i", "" + i);

           double heightininch = Math.sqrt(Math.pow(screenHeight, 2));

           Log.e("height in inch", "" + heightininch);

           size = Math.sqrt(Math.pow(screenWidth, 2) + Math.pow(screenHeight, 2));

           Log.e("screen", "" + size);

           if (size >= 6) {

             if (scrollViewHeight >= (int)i) {

               DownIndicator.setVisibility(View.VISIBLE);

               // TopIndicator.setVisibility(View.VISIBLE);

             }
           }
        }
    });