ScrollPickerView

open class ScrollPickerView : View, ValueAnimator.AnimatorUpdateListener

Constructors

ScrollPickerView
Link copied to clipboard
open fun ScrollPickerView(context: Context, attrs: AttributeSet)
ScrollPickerView
Link copied to clipboard
open fun ScrollPickerView(context: Context, attrs: AttributeSet, defStyleAttr: Int)

Types

OnItemSelectedListener
Link copied to clipboard
interface OnItemSelectedListener

Functions

canScrollVertically
Link copied to clipboard
open fun canScrollVertically(direction: Int): Boolean
getSelectedPosition
Link copied to clipboard
open fun getSelectedPosition(): Int
获取当前选中项
isLoopEnable
Link copied to clipboard
open fun isLoopEnable(): Boolean
onAnimationUpdate
Link copied to clipboard
open fun onAnimationUpdate(animation: ValueAnimator)
onTouchEvent
Link copied to clipboard
open fun onTouchEvent(event: MotionEvent): Boolean
setAdapter
Link copied to clipboard
open fun setAdapter(adapter: PickAdapter)
设置适配器
setCenterTextColor
Link copied to clipboard
open fun setCenterTextColor(color: Int)
设置中部字体颜色
setGravity
Link copied to clipboard
open fun setGravity(gravity: Int)
设置文本对齐方式,计算文本绘制起始点的X坐标
setLayoutParams
Link copied to clipboard
open fun setLayoutParams(params: ViewGroup.LayoutParams)
setLoopEnable
Link copied to clipboard
open fun setLoopEnable(enable: Boolean)
setOnItemSelectedListener
Link copied to clipboard
open fun setOnItemSelectedListener(itemSelectedListener: ScrollPickerView.OnItemSelectedListener)
setOutsideTextColor
Link copied to clipboard
open fun setOutsideTextColor(color: Int)
设置外部字体颜色
setRowSpacing
Link copied to clipboard
open fun setRowSpacing(rowSpacing: Float)
设置文本行间距,单位px
setSelectedPosition
Link copied to clipboard
open fun setSelectedPosition(position: Int)
设置当前选中项
setTextRatio
Link copied to clipboard
open fun setTextRatio(textRatio: Float)
设置放大倍数
setTextRows
Link copied to clipboard
open fun setTextRows(rows: Int)
设置文本显示的行数,仅当高为WRAP_CONTENT时有效
setTextSize
Link copied to clipboard
open fun setTextSize(textSize: Float)
设置文本字体大小,单位px

Properties

GRAVITY_CENTER
Link copied to clipboard
val GRAVITY_CENTER: Int
文本对齐方式,居中
GRAVITY_LEFT
Link copied to clipboard
val GRAVITY_LEFT: Int
文本对齐方式,居左
GRAVITY_RIGHT
Link copied to clipboard
val GRAVITY_RIGHT: Int
文本对齐方式,居右