0

我在图标中设置了宽度和高度。该图标被隐藏,并且在增加其高度和宽度时也会在标签中反映出来。

我需要增加图像的宽度和高度,而不需要增加标签的宽度和高度。

我正在使用 react-native-paper 包

  <FAB.Group 
                color="white"
                fabStyle={this.state.open ? {borderWidth: 1, borderColor: 'white', shadowOpacity: 0} : {shadowOpacity: 0}}
                theme={this.state.open ? {colors: {accent: 'transparent'}} : undefined}
                style={{paddingBottom: 100, paddingRight: SCREEN_WIDTH/2 - 45}}
                open={this.state.open}
                icon={this.state.open ? 'close' : 'plus'}
                actions={[
                    {
                        icon: (props) => <Image source={{uri: image}} style = {{width:50, height:50, tintColor:'white'}} {...props} />,
                        label: 'NEW',
                        onPress: onNew,
                        style: {backgroundColor:'transparent'}
                    },
                    {
                        icon: (props) => <Image source={{uri: IMage}} style = {{width:50, height:50, tintColor:'white'}} {...props} />,
                        label: 'NEW',
                        onPress: New,
                        style: {backgroundColor:'transparent'}
                    },
                ]}
                onStateChange={({ open }) => this.setState({ open })}
                onPress={() => {
                    if (this.state.open) {
                    // do something if the speed dial is open
                    }
                }}
                {...this.props}
            />
4

1 回答 1

0

我完全避免这样的问题并使用 React 原生 UI 工具包。 https://akveo.github.io/react-native-ui-kitten/

于 2020-03-10T08:28:13.357 回答