This time I will show you how to implement floating buttons in React Native. What are the precautions for implementing floating buttons in React Native? The following is a practical case, let's take a look.
React Native SuspensionRendering
Installation method
npm i react-native-action-button --save react-native link react-native-vector-icons
Sample code
<View style={styles.container}> <Text style={styles.welcome}> 悬浮按钮组件示例 </Text> <ActionButton buttonColor="rgba(231,76,60,1)" position='left' verticalOrientation='up'> <ActionButton.Item buttonColor='#9b59b6' title="New Task" onPress={() => console.log("notes tapped!")}> <Icon name="ios-create-outline" style={styles.actionButtonIcon} /> </ActionButton.Item> <ActionButton.Item buttonColor='#3498db' title="Notifications" onPress={() => {}}> <Icon name="ios-notifications-off" style={styles.actionButtonIcon} /> </ActionButton.Item> <ActionButton.Item buttonColor='#1abc9c' onPress={() => {}}> <Icon name="ios-done-all-outline" style={styles.actionButtonIcon} /> </ActionButton.Item> </ActionButton> <ActionButton buttonColor="rgba(231,76,60,1)" onPress={() => { alert('你点了我!')}} renderIcon={() => (<View style={styles.actionButtonView}><Icon name="ios-create-outline" style={styles.actionButtonIcon} /> <Text style={styles.actionButtonText}>新增</Text> </View>)} /> </View>
Main parameter description
ActionButton
ActionButton.Item
Detailed explanation of webpack mobile terminal automated build rem steps
Angular5 step instructions for adding style class to component tags
The above is the detailed content of How to implement floating buttons in React Native. For more information, please follow other related articles on the PHP Chinese website!