React Native 底部工作表更改栏颜色

问题描述 投票:0回答:1

如何更改底部表单模式顶部栏的颜色?我查看了文档和软件包,但没有看到任何可以更改它的内容。我尝试更改背景颜色,但效果不佳。

<BottomSheetModal
  ref={bottomSheetModalRef}
  index={0}
  snapPoints={snapPoints}
  onChange={handleSheetChanges}>
  <View
    style={{
      flex: 1,
      backgroundColor: Colors.darkMode.cards1,
    }}>
    <Pressable
      style={{
        flexGrow: 1,
        alignItems: 'center',
        height: 40,
        borderRadius: 9,
        paddingVertical: 4,
        paddingHorizontal: 2,
        justifyContent: 'center',
      }}>
      <Text
        style={{
          color: Colors.gtechGold,
          fontSize: 17,
          fontFamily: 'RobotoSlab-Medium',
        }}>
        Test
      </Text>
    </Pressable>
  </View>
</BottomSheetModal>

enter image description here

react-native
1个回答
0
投票

您可以修改两个属性来更改底部工作表上的顶栏颜色:handleStylehandleIndicatorStyle

 <BottomSheetModal
  ..."your props"
  handleIndicatorStyle={{backgroundColor:"red"}}
  handleStyle={{backgroundColor:"red"}}
  >
      ...."your code"...
</BottomSheetModal>
© www.soinside.com 2019 - 2024. All rights reserved.