Complete the code to create a style object using StyleSheet.
const styles = StyleSheet.[1]({ container: { flex: 1, backgroundColor: '#fff' } });
StyleSheet.create is the correct method to define styles in React Native.
Complete the code to apply the style to a View component.
<View [1]={styles.container}>
<Text>Hello</Text>
</View>The 'style' prop is used to apply styles to React Native components.
Fix the error in the style definition to ensure platform consistency.
const styles = StyleSheet.create({
text: {
fontSize: 16,
color: 'black',
[1]: 'bold'
}
});fontWeight is the correct property to set text boldness in React Native.
Fill both blanks to create a style that centers content vertically and horizontally.
const styles = StyleSheet.create({
center: {
justifyContent: '[1]',
alignItems: '[2]'
}
});Both justifyContent and alignItems set to 'center' align content in the middle.
Fill all three blanks to create a style for a button with padding, background color, and rounded corners.
const styles = StyleSheet.create({
button: {
padding: [1],
backgroundColor: '[2]',
borderRadius: [3]
}
});Padding 15, background color '#007AFF' (blue), and borderRadius 8 create a nice button style.