textview随seekbar一起移动
来源:互联网 发布:js 特效 同意网站协议 编辑:程序博客网 时间:2024/06/18 16:45
主要思路是自定义一个SeekBar,然后上面的跟随窗口是用popwindow来实现的
主要的跟随代码如下:
protected synchronized void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
int thumb_x = this.getProgress() * (this.getWidth() - mThumbWidth)
/ this.getMax();
int middle = this.getHeight() / 2+40;
super.onDraw(canvas);
if (mPopupWindow != null) {
try {
this.getLocationOnScreen(mPosition);
mPopupWindow.update(thumb_x+mPosition[0] - getViewWidth(mView) / 2+mThumbWidth/2,
middle,getViewWidth(mView),getViewHeight(mView));
} catch (Exception e) {
// TODO: handle exception
}
}
}
这段代码主要重写了seekbar的ondraw方法,来判断跟随窗口该显示在哪个地方
- textview随seekbar一起移动
- Android 使用SeekBar时动态显示进度且随SeekBar一起移动
- android TextView文字跟随seekBar滑动条滑块的位置移动
- seekbar textview 占位符
- SeekBar跟TextView跟着拖动
- SeekBar与TextView简单联动
- SeekBar实现实现进度提示随thum移动,自定义View
- 自定义SeekBar实现实现进度提示随thum移动
- 制作随鼠标一起移动的层
- SeekBar实现滑动上侧滑动显示TextView
- 双拖动条自定义seekbar(带浮动textView)
- 关于SeekBar拖动时有一个跟着动的TextView
- 基本的UI组件(TextView、EditText、Button、ImageView、SeekBar)学习
- SeekBar
- SeekBar
- SeekBar
- SeekBar
- SeekBar
- Centos yum的详细使用方法
- jdom学习:读取xml文件
- GCC 基本使用规则
- Timing Wheel 定时轮算法
- JAVA内存使用--如何计算一个Java对象占用的字节数
- textview随seekbar一起移动
- Android应用如何监听自己是否被卸载(转载)
- Linux新手要了解的十个知识点
- java注释方法
- Java HashMap浅析
- java学习之路---继承
- JSTL的c:forEach标签(${status.index})
- 对象引用和赋值的理解
- Google Maps Android API V2在Android SDK level 17模拟器上运行时的问题解决方法