Flex.Item не работает в Ant Design Mobile React Native - PullRequest
0 голосов
/ 17 апреля 2020

Я пытаюсь использовать функцию Flex в Design Design Mobile, чтобы расположить кнопки со смещением направления столбца. Кажется, что Flex и Flex.Item не работают. Позиции кнопок сгруппированы вместе.

enter image description here

Приложение. js

import React from 'react';
import {Text, View, StyleSheet, Image, TouchableOpacity, SafeAreaView} from 'react-native';
import {Provider, Button, WhiteSpace, Flex} from '@ant-design/react-native';
import customTheme from './src/styles/customTheme';


const App = () => {
   return (
      <Provider theme={customTheme}>
         <SafeAreaView>
            <View>  
               <Flex direction='column'>
                  <Flex.Item>                                   
                     <TouchableOpacity style={styles.facebookLoginButton} activeOpacity={0.5}>                                
                        <Image 
                           source={require('./img/facebookLoginButton.png')}
                           style={styles.img}                            
                        />        
                     </TouchableOpacity>         
                  </Flex.Item>
                  <Flex.Item>                       
                     <TouchableOpacity style={styles.googleLoginButton} activeOpacity={0.5}>     
                        <Image 
                           source={require('./img/googleLoginButton.png')}                                    
                        />      
                     </TouchableOpacity>                        
                  </Flex.Item>               
               </Flex>               
            </View>
         </SafeAreaView>
      </Provider>
   );
};
export default App;

const styles = StyleSheet.create({  
   facebookLoginButton: {              
      width: 240,
      height: 40
   },
   googleLoginButton: {      
      borderColor: '#D3D3D3',
      borderWidth: 0.5,
      width: 240,
      height: 40
   }
});
...