<ScrollView
horizontal
showsHorizontalScrollIndicator={false}
style={{
width: '100%',
}}
ref={scrollView => {
if (scrollView !== null) {
setTimeout(() => {
//父组件传入的参数的option(用于计算偏移,根据自己实际情况)
scrollView.scrollTo({ x: 50 * (dataList.length - 1), y: 0, animated: true }, 1)
})
}
}}
scrollIndicatorInsets={{ right: Platform.OS === 'ios' ? 1 : 0 }} // 修复iphonex系列 滚动条位置偏左或者居中 正常应是贴右侧边
>
{this.renderIcons()}
</ScrollView>