HorizontalView子view居中

val hsvWidth =horizontal.width

val left = view.left

val width = view.width

val offset = left + width /2 - hsvWidth/2

horizontal.smoothScrollTo(offset, 0)

你可能感兴趣的:(HorizontalView子view居中)