如何更改 React Native Swiper 点的默认位置?
How to change the default position of React Native Swiper dots?
我正在使用这个 RN 包 https://reactnativeexample.com/swiper-slider-for-react-native-and-react-native-web/
我正在尝试将分页点向上移动一点。
这是我的代码
<Swiper
from={1}
minDistanceForAction={0.1}
controlsProps={{
dotsTouchable: true,
prevPos: 'left',
nextPos: 'right',
nextTitle: '',
prevTitle: '',
dotsWrapperStyle: { },
nextTitleStyle: { color: 'red', fontSize: 24, fontWeight: '500' },
}}
>
<View style={[styless.slideContainer]}>
//some views
</View>
</Swiper>
有办法移动点吗?因为滑块视图的高度很小,所以这些点被其他视图隐藏了。
你可以使用这个:
<Swiper
from={1}
minDistanceForAction={0.1}
controlsProps={{
dotsTouchable: true,
prevPos: 'left',
nextPos: 'right',
nextTitle: '',
prevTitle: '',
dotsWrapperStyle: { marginBottom: 20 },
nextTitleStyle: { color: 'red', fontSize: 24, fontWeight: '500' },
}}
>
<View style={[styless.slideContainer]}>
//some views
</View>
</Swiper>
唯一的变化是 dotsWrapperStyle 属性的边距值。
确保根据您的需要更改值。
我正在使用这个 RN 包 https://reactnativeexample.com/swiper-slider-for-react-native-and-react-native-web/
我正在尝试将分页点向上移动一点。
这是我的代码
<Swiper
from={1}
minDistanceForAction={0.1}
controlsProps={{
dotsTouchable: true,
prevPos: 'left',
nextPos: 'right',
nextTitle: '',
prevTitle: '',
dotsWrapperStyle: { },
nextTitleStyle: { color: 'red', fontSize: 24, fontWeight: '500' },
}}
>
<View style={[styless.slideContainer]}>
//some views
</View>
</Swiper>
有办法移动点吗?因为滑块视图的高度很小,所以这些点被其他视图隐藏了。
你可以使用这个:
<Swiper
from={1}
minDistanceForAction={0.1}
controlsProps={{
dotsTouchable: true,
prevPos: 'left',
nextPos: 'right',
nextTitle: '',
prevTitle: '',
dotsWrapperStyle: { marginBottom: 20 },
nextTitleStyle: { color: 'red', fontSize: 24, fontWeight: '500' },
}}
>
<View style={[styless.slideContainer]}>
//some views
</View>
</Swiper>
唯一的变化是 dotsWrapperStyle 属性的边距值。 确保根据您的需要更改值。