嗨,我正在使用反应原生和反应原生基地,我正在尝试使用FAB作为滚动到顶部按钮 - 其中没有其他动作按钮 - 。可以理解我可以使用按钮,但FAB设置起来相当简单。
我有以下代码:
<Fab
active="true"
containerStyle={{ }}
style={{ backgroundColor: 'rgba(0, 0, 0)' }}
position="bottomRight"
onPress={this.scrollToTop.bind(this)}>
<Icon name="ios-arrow-up" />
</Fab>
当我按下FAB时,不仅没有任何反应,任何在其后面“可点击”的东西都会被触发。有任何想法吗?
我遇到了同样的问题并通过将FAB放在Container而不是Content中来解决它,如此链接中所述:http://discuss.nativebase.io/t/how-to-use-a-fab-in-page-with-a-list/237/3。
<Container>
<Content>
<List />
<AnyComponent />
</Content>
<Fab/>
</Container>
你为什么不用一个简单的视图?
<View style={{
position: 'absolute',
bottom: 30,
right: 30,
width: 100,
height: 100,
borderRadius: 50
}}>
<Icon/>
</View>