mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Add support for layout gravity to ToastAndroid
Summary: Add support for top, bottom, and center layout gravity to ToastAndroid Reviewed By: AaaChiuuu Differential Revision: D3590224 fbshipit-source-id: 84dbbcfbe4133f291d62723c5c261acd7b32b46e
This commit is contained in:
committed by
Facebook Github Bot 4
parent
768caf5e08
commit
12ec213c0d
@@ -60,7 +60,43 @@ var ToastExample = React.createClass({
|
||||
<TouchableWithoutFeedback
|
||||
onPress={() =>
|
||||
ToastAndroid.show('This is a toast with long duration', ToastAndroid.LONG)}>
|
||||
<Text style={styles.text}>Click me too.</Text>
|
||||
<Text style={styles.text}>Click me.</Text>
|
||||
</TouchableWithoutFeedback>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="Toast with top gravity">
|
||||
<TouchableWithoutFeedback
|
||||
onPress={() =>
|
||||
ToastAndroid.showWithGravity(
|
||||
'This is a toast with top gravity',
|
||||
ToastAndroid.SHORT,
|
||||
ToastAndroid.TOP,
|
||||
)
|
||||
}>
|
||||
<Text style={styles.text}>Click me.</Text>
|
||||
</TouchableWithoutFeedback>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="Toast with center gravity">
|
||||
<TouchableWithoutFeedback
|
||||
onPress={() =>
|
||||
ToastAndroid.showWithGravity(
|
||||
'This is a toast with center gravity',
|
||||
ToastAndroid.SHORT,
|
||||
ToastAndroid.CENTER,
|
||||
)
|
||||
}>
|
||||
<Text style={styles.text}>Click me.</Text>
|
||||
</TouchableWithoutFeedback>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="Toast with bottom gravity">
|
||||
<TouchableWithoutFeedback
|
||||
onPress={() =>
|
||||
ToastAndroid.showWithGravity(
|
||||
'This is a toast with bottom gravity',
|
||||
ToastAndroid.SHORT,
|
||||
ToastAndroid.BOTTOM,
|
||||
)
|
||||
}>
|
||||
<Text style={styles.text}>Click me.</Text>
|
||||
</TouchableWithoutFeedback>
|
||||
</UIExplorerBlock>
|
||||
</UIExplorerPage>
|
||||
|
||||
Reference in New Issue
Block a user