【问题标题】:React native create rectangle bottom, plus half rectangle is cut by circlereact native创建矩形底部,加上半个矩形被圆形切割
【发布时间】:2019-12-05 12:54:38
【问题描述】:

你好我的任务是创建自定义形状图。在底部,图形的形状是矩形,在矩形的一半顶部被圆形切割。谁能告诉我从现在开始的方向?

【问题讨论】:

    标签: reactjs native shapes


    【解决方案1】:
    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;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-02
      相关资源
      最近更新 更多