public class CustomScrollView extends ScrollView {public CustomScrollView(Context context) {super(context);// TODO Auto-generated constructor stub}public CustomScrollView(Context context, AttributeSet attrs) {super(context, attrs);// TODO Auto-generated constructor stub}private toShowInterface callback;public interface toShowInterface {void toShow(int t);};public void setCallback(toShowInterface callback) {this.callback = callback;}@Overrideprotected void onScrollChanged(int l, int t, int oldl, int oldt) {// TODO Auto-generated method stubsuper.onScrollChanged(l, t, oldl, oldt);callback.toShow(t);}}


回调

@Overridepublic void toShow(int t) {// LogUtil.log("toShow=" + t + "/topImg=" + topImg.getHeight());if (topImg.getHeight() <= t ) {labelCheckView2.setVisibility(View.VISIBLE);} else {labelCheckView2.setVisibility(View.GONE);}}


更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. Android 长按home键强制关闭应用后,在哪里
  2. 三年Android技术支持工作总结及心得
  3. android的消息处理机制(Looper,Handler,M
  4. fix android build error : undefined re
  5. gen文件无法生成
  6. Android stutio 中怎么将XML中文件快速fi
  7. Android中dp sp和pt
  8. Android的垃圾回收机制
  9. Android高手进阶教程(四)之 ----Android
  10. Android中Service完全解析