sets size along the primary axis
if primary axis is horizontal, flexBasis would be the width,
if primary axis is vertical, flexBasis would be the height
sets size along the primary axis
if primary axis is horizontal, flexBasis would be the width,
if primary axis is vertical, flexBasis would be the height
determines the alignment of the entire content
different from alignItems because that determines the alignment of the items within each line.
determines the alignment of the entire content
different from alignItems because that determines the alignment of the items within each line.
alignSelf has the properties flex (start, end, center), auto, baseline, center, stretch
alignSelf has the properties flex (start, end, center), auto, baseline, center, stretch
alignItems has properties flex (start,end), center, baseline, stretch
The secondary axis is the other axis than the main axis, if the main axis is vertical (column), then the secondary axis is horizontal (row)
alignItems has properties flex (start,end), center, baseline, stretch
The secondary axis is the other axis than the main axis, if the main axis is vertical (column), then the secondary axis is horizontal (row)
flexDirection as column, sets main axis to be vertical
flexDirection as column, sets main axis to be vertical
To align the items in the container, we use justifyContent property
With the options center, flex (start, end), space(around, between, evenly)
It aligns the items along the main axis
The main axis is determined by flexDirection property
To align the items in the container, we use justifyContent property
With the options center, flex (start, end), space(around, between, evenly)
It aligns the items along the main axis
The main axis is determined by flexDirection property
<View>
<View style={{ width: 200 height: 100, backgroundColor: "red" }} />
<View style={{ width: 200 height: 300, backgroundColor: "green" }}/>
</View>
<View>
<View style={{ width: 200 height: 100, backgroundColor: "red" }} />
<View style={{ width: 200 height: 300, backgroundColor: "green" }}/>
</View>
With Flex we can easily build layouts that are consistent across different screen sizes
components could either be given flex ratios or fixed sizes
<View>
<View style={{ flex: 0.5, backgroundColor: "red" }} />
<View style={{ flex: 0.25, backgroundColor: "green" }}/>
</View>
With Flex we can easily build layouts that are consistent across different screen sizes
components could either be given flex ratios or fixed sizes
<View>
<View style={{ flex: 0.5, backgroundColor: "red" }} />
<View style={{ flex: 0.25, backgroundColor: "green" }}/>
</View>
import { useDeviceOrientation } from "@react-native-community/hooks";
This hook is used to identify the present device orientation.
useDeviceOrientation()
import { useDeviceOrientation } from "@react-native-community/hooks";
This hook is used to identify the present device orientation.
useDeviceOrientation()
we use the Platform Class
import it and use the OS property.
Platform.OS
we use the Platform Class
import it and use the OS property.
Platform.OS
button: {
backgroundColor: "#000"
}
})
button: {
backgroundColor: "#000"
}
})
A component can use multiple style objects
<SafeAreaProvider style={[styles.container, newStyler.button]}>
...
<SafeAreaProvider/>
const styles = stylesheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
}
});
A component can use multiple style objects
<SafeAreaProvider style={[styles.container, newStyler.button]}>
...
<SafeAreaProvider/>
const styles = stylesheet.create({
container: {
flex: 1,
backgroundColor: "#fff"
}
});
accepts:
1. title
2. message
3. array of options-
accepts:
1. text
2. onPress method
accepts:
1. title
2. message
3. array of options-
accepts:
1. text
2. onPress method
console.log(text);;
});
console.log(text);;
});
we can import alert API from react-native
it has 2 methods, prompt & alert
-Alert.prompt- (only works on iOS so far)
accepts:
1. title
2. message
3. text -
this is the text that the user enters into the console
and it accepts a callback to perform actions on that text
we can import alert API from react-native
it has 2 methods, prompt & alert
-Alert.prompt- (only works on iOS so far)
accepts:
1. title
2. message
3. text -
this is the text that the user enters into the console
and it accepts a callback to perform actions on that text
Darn! this tutorial is OLD
Darn! this tutorial is OLD
TouchableHighlight
TouchableOpacity
are the known 'cross-platform' touchable components
TouchableHighlight
TouchableOpacity
are the known 'cross-platform' touchable components
docs.expo.dev/develop/user...
docs.expo.dev/develop/user...