Зміст курсу
Foundations of React Native
Foundations of React Native
Challenge: Adding Styles
Challenge time!
Now, it's your turn to implement styling into our current app. Follow these steps:
Steps
- Import
StyleSheet
fromreact-native
; - Initialize styles with
StyleSheet.create()
; - Specify the following class names with their respective properties and values:
- container:
flex: 1, justifyContent: "center", alignItems: "center", backgroundColor: "#00FFAB", flexDirection: "row",
; text
:fontSize: 18, color: "#913f92",
;image
:marginLeft: 10,
.
- container:
- Apply the created class names to the appropriate UI elements:
- Apply
container
to theView
; - Apply
text
to theText
; - Apply
image
to theImage
.
- Apply
We should see the following result after implementing those changes.
Execute the command in the terminal to copy the project and start working on the challenge.
Go to the createdd folder where the project files are located.
Install the necessary packages.
To start the app and see the initial appearance, run the following command in the terminal:
If you encounter any difficulties during the challenge implementation, we recommend checking the following recording with a step-by-step guide on how to do everything. Good luck!
In Practice
Дякуємо за ваш відгук!