У меня есть видеоплеер в React Native, который находится вверху страницы, но я хочу, чтобы он был в центре экрана. Как я могу этого добиться. Вот код
return (
<View>
<KSYVideo
source = {{
uri: "rtmp://184.72.239.149/vod/mp4:bigbuckbunny_1500.mp4"
}} // Can be a URL or a local file.
ref = {ref => {
this.player = ref;
}} // Store reference
volume = {1.0}
muted = {false}
paused = {this.state.paused} // Pauses playback entirely.
resizeMode = "stretch" // Fill the whole screen at aspect ratio.*
repeat = {true} // Repeat forever.
playInBackground = {false}
progressUpdateInterval = {250.0}
style = {{ height: 300, justifyContent: 'center',
alignItems: 'center' }}
/>
Родительский просмотр значит?
Я уже установил в разделе стилей





Попробуй это.
<View style = {{justifyContent: 'center'}} >
<KSYVideo
source = {{
uri: "rtmp://184.72.239.149/vod/mp4:bigbuckbunny_1500.mp4"
}} // Can be a URL or a local file.
ref = {ref => {
this.player = ref;
}} // Store reference
volume = {1.0}
muted = {false}
paused = {this.state.paused} // Pauses playback entirely.
resizeMode = "stretch" // Fill the whole screen at aspect ratio.*
repeat = {true} // Repeat forever.
playInBackground = {false}
progressUpdateInterval = {250.0}
style = {{ height: 300,
alignSelf: 'center' }}
/>
</View>
Попробуйте дать
justifyContent: 'center'родительскому виду.