Навигация по нижней вкладке с дугой / горбом - PullRequest
0 голосов
/ 23 декабря 2018

enter image description here

Как создать что-то, как указано выше в реагировать на нативном?

1 Ответ

0 голосов
/ 24 декабря 2018

Я сделал с АРТ библиотекой.Это не идеально, но это может дать идею. Пожалуйста, проверьте закуски.

enter image description here https://snack.expo.io/@nazrdogan/intrigued-yogurt

import * as React from 'react';
import { Text, View, StyleSheet, ART, Dimensions } from 'react-native';
import { Constants } from 'expo';
const { Surface, Group, Shape, Path } = ART;
import { Card } from 'react-native-paper';
import { IconButton, Colors, FAB } from 'react-native-paper';
const MyComponent = () => (
  <FAB style={styles1.fab} onPress={() => console.log('Pressed')} />
);
const styles1 = StyleSheet.create({
  fab: {
    position: 'absolute',
    alignSelf: 'center',
    bottom: 30,
  },
});
export default class App extends React.Component {
  render() {
    let deviceWidth = Dimensions.get('window').width;
    return (
      <View style={styles.container}>
        <View>
          <Surface width={deviceWidth} height={60}>
            <Shape
              d={new Path()
                .moveTo(0, 0)
                .lineTo(0, deviceWidth)
                .lineTo(deviceWidth, deviceWidth)
                .lineTo(deviceWidth, 0)
                .move(-deviceWidth / 2 + 60, 0)
                .arc(-120, 0, 80, 120)
                .close()}
              fill={'#f00'}
            />
          </Surface>
          <IconButton
            style={{ left: 0, position: 'absolute', zIndex: 100 }}
            icon="add-a-photo"
            color={'white'}
            size={30}
            onPress={() => console.log('Pressed')}
          />
          <MyComponent />
          <IconButton
            style={{ right: 0, position: 'absolute', zIndex: 100 }}
            icon="add-a-photo"
            color={'white'}
            size={30}
            onPress={() => console.log('Pressed')}
          />
        </View>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingTop: Constants.statusBarHeight,
    backgroundColor: '#ecf0f1',
  },
});
...