Open ChristianTucker opened 7 years ago
let containerStyle = {};
let pageStyle = {};
if (Platform.OS == 'android') {
let offset = ((height - StatusBar.currentHeight) - width) / 2;
containerStyle.transform = [{rotate: "90deg"}];
containerStyle.width = height - StatusBar.currentHeight;
containerStyle.height = width;
containerStyle.top = offset;
containerStyle.left = offset * -1;
pageStyle.transform = [{rotate: "-90deg"}];
pageStyle.width = width;
pageStyle.height = height - StatusBar.currentHeight;
pageStyle.top = offset * -1; //left
pageStyle.right = offset * -1; //top
} else {
containerStyle.flex = 1;
pageStyle.flex = 1;
}
<View style={containerStyle}>
<Swiper
loop={false}
showsButtons={false}
showsPagination={false}
horizontal={Platform.OS == 'android'}
width={Platform.OS == 'android' ? height : width}
height={Platform.OS == 'android' ? width : height}
>
<Page1 style={[{backgroundColor: '#9297A1'}, pageStyle]}/>
<Page2 style={[{backgroundColor: '#9297A1'}, pageStyle]}/>
</Swiper>
</View>
Hope this help
+1
+1
+1
@leecade Would you consider a PR changing the implementation to using Animated
and a over-sized fixed position container that can be animated to slide. You wouldn't lose any features and it would support Android and iOS exactly the same without any device-specific features.
+1 , so this problem is still not solved?
dup #174 , #199 +1 It seems hard work but worth it!
see #595 and my fix (apart from bullets not showing correct index) pull req. https://github.com/leecade/react-native-swiper/pull/643
+1
+1
This moves the dots to the right, but swiping is still left to right.