React Native创建矩形底部,再加上半个矩形被圆形切开

React Native创建矩形底部,再加上半个矩形被圆形切开

您好,我要创建自定义形状图形。图形的底部是矩形,矩形的上半部是圆形。谁能告诉我从现在开始的方向?

aa4892278 回答:React Native创建矩形底部,再加上半个矩形被圆形切开

import React,{ Component } from 'react';
import { View } from 'react-native';
import { Icon} from 'react-native-elements'

class BottomNavigator extends Component {
    render() {
        return (
            <View style={{
                flex: 1,flexDirection: 'column',backgroundColor: '#f8f4f4'

            }}>
                <View style={{ position: 'absolute',alignSelf: 'center',backgroundColor: '#f8f4f4',width: 70,height: 70,borderRadius: 35,bottom: 25,zIndex: 10 }}>
                    <Icon
                        name='add'
                        type='material'
                        color='#f00'
                        containerStyle={{ alignSelf: 'center' }}
                        reverse
                        size={28}
                        onPress={() => {}}
                    />
                </View>
                <View style={{ position: 'absolute',backgroundColor: '#2196F3',bottom: 0,zIndex: 1,width: '100%',height: 60,flexDirection: 'row',justifyContent: 'space-between',paddingHorizontal: 15,paddingVertical: 10 }}>
                    <Icon
                        name='menu'
                        type='material'
                        color='#fff'
                        onPress={() => {}}

                    />
                    <View style={{ flexDirection: 'row',justifyContent: 'center' }}>
                        <Icon
                            name='favorite'
                            type='material'
                            color='#fff'
                            onPress={() => {}}
                            containerStyle={{ marginHorizontal: 16 }}
                        />
                        <Icon
                            name='search'
                            type='material'
                            color='#fff'
                        />
                    </View>
                </View>
            </View>
        );
    }
}

export default BottomNavigator;
本文链接:https://www.f2er.com/2970091.html

大家都在问