Using React Native with Expo. Having difficulties centering custom imported font, at iOS. Android rendering with no issues, the text is vertically centered perfectly. Using iOS it is slightly upper than the center.
(Native Font centering well on both emulators - Android and iOS).
Any ideas how this could be solved?
Code below:
import React, { Component } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Font } from 'expo';
export default class extends Component {
constructor(props) {
super(props);
this.state = {
isReady: false
};
}
async componentDidMount() {
await Font.loadAsync({
'KlavikaBold': require('./KlavikaBold.otf'),
});
this.setState({ isReady: true });
}
render() {
if (!this.state.isReady) {
return <Expo.AppLoading />;
}
return (
<View style={styles.container}>
<Text style={styles.content}>Home!</Text>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
content: {
backgroundColor: 'green',
color: 'white',
padding: 10,
textAlignVertical: 'center',
fontFamily: 'KlavikaBold',
fontSize: 20,
}
})