1.怎么重写Seekbar的onStartTrackingTouch和onStopTrackingTouch监听
2.在使用object创建继承自SeekBar.OnSeekBarChangeListener的匿名类的对象时提示object is not abstract and does not implement abstract member
如何解决呢?
对于问题2.只需重写SeekBar.OnSeekBarChangeListener的onProgressChanged方法即可解决问题
代码如下:
mySeekBar.setOnSeekBarChangeListener(object : SeekBar.OnSeekBarChangeListener{
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {//重写此方法即可解决问题2.}
override fun onStartTrackingTouch(seekBar: SeekBar?) {}
override fun onStopTrackingTouch(seekBar: SeekBar?) {}
})
业余选手,请多关照