2

我想一起使用react-native-popup-menureact-native-floating-action-button组件。我试过了 :

<MenuTrigger>
    <FloatingActionButton
        size={56}
        textDisable
        iconName="directions"
        iconType="material-icons"
        shadowColor="#000"
        iconColor="white"
        backgroundColor="#405914"
    />
</MenuTrigger>

此代码不会触发 MenuTrigger,因为触发了 FloatingActionButton 的 onPress。


我也尝试过这种东西:

<MenuTrigger customStyles={{ TriggerTouchableComponent: FloatingActionButton }} />

这个触发器与 MenuTrigger 一起使用,但我无法自定义 FAB 按钮的样式。

你能给我一个解决方案吗?:)

谢谢

4

1 回答 1

2

根据文档,您可以使用triggerTouchable.

      <MenuTrigger
        customStyles={{
          TriggerTouchableComponent: Button,
          triggerTouchable: { title: 'Select (Custom Touchables)' },
        }}
      />
于 2018-12-12T17:05:26.357 回答