如何使这个 React-Native Expo Snack 中的图标居中?
How to centre the icon in this React-Native Expo Snack?
我正在使用 Expo and have a snack that uses react-native-elements,但我似乎无法让通知图标完全居中。它看起来稍微偏左。我尝试设置 marginRight: 0
但这没有帮助。
谁能帮我做点心?
您应该在图标样式而不是按钮样式上设置 marginRight: 0
。 react-native-elements 的按钮图标属性接受样式对象。
将您当前的 <Button />
替换为下面的那个,图标应该居中。
<Button
raised
icon={{name: 'notifications', size: 90, style: {marginRight: 0}}}
buttonStyle={{backgroundColor: '#ff4f00', borderRadius: 10}}
/>
我正在使用 Expo and have a snack that uses react-native-elements,但我似乎无法让通知图标完全居中。它看起来稍微偏左。我尝试设置 marginRight: 0
但这没有帮助。
谁能帮我做点心?
您应该在图标样式而不是按钮样式上设置 marginRight: 0
。 react-native-elements 的按钮图标属性接受样式对象。
将您当前的 <Button />
替换为下面的那个,图标应该居中。
<Button
raised
icon={{name: 'notifications', size: 90, style: {marginRight: 0}}}
buttonStyle={{backgroundColor: '#ff4f00', borderRadius: 10}}
/>