简体   繁体   中英

how can i flip image in react-native?

i'm trying to flip image. i tried to rotate method but it doesn't work

this is my image

在此处输入图像描述

i want to flip this image like this

->>
在此处输入图像描述

this is my code.

    const Container = styled.View`
      flex-direction: row;
      background-color: #FFF;
      border-radius: 8px;
      margin:4px 16px;
      padding: 8px 16px;
      align-items: center;
      border:1px solid white;
      border-bottom-color: #DCDCDC;
    `;

    const DeleteButton = styled.TouchableOpacity`
    `;

    const Icon = styled.Image`
      width: 24px;
      height: 24px;
    `;

    const TodoItem = () => {
      return (
        <Container>
        <DeleteButton onPress={() => setModalVisible(true)}>
            <Icon source={require('../../../../Assets/Images/ic_dot_menu.png')} />
          </DeleteButton>
        </Container>
      );
    };
    export default TodoItem;

what code should i fix?

try this:

<Icon style={{transform: [{rotateY: '90deg'}]}} source={require('../../../../Assets/Images/ic_dot_menu.png')} />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM