It seems that with position:absolute
in use an element cannot be centred using justifyContent
or alignItems
. There\'s a workaround to use
create a full-width View
with alignItems: "center"
then insert desired children inside.
import React from "react";
import {View} from "react-native";
export default class AbsoluteComponent extends React.Component {
render(){
return(
{this.props.children}
)
}
}
you can add properties like bottom: 30
for bottom aligned component.