微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

我不能使用flexbox进行可触摸的不透明/可按压如何将这两个元素连续对齐?

如何解决我不能使用flexbox进行可触摸的不透明/可按压如何将这两个元素连续对齐?

<View style = {{flex : 0.2,backgroundColor : 'white',flexDirection : 'row',justifyContent : 'space-around',alignItems : 'center'}}>
    <pressable style = {{ height : '100%',width : '100%'}}>
    <Image style = {{height : '60%',width : '10%'}} source = {require('../../DataStorage/SymbolsPicture/arrowLeft.png')}></Image> 
    </pressable>
    <pressable style = {{ height : '100%',width : '10%'}} source = {require('../../DataStorage/SymbolsPicture/arrowRight.png')}></Image> 
    </pressable>
    </View> 

What I get

我需要将两个箭头都排在同一行中。

解决方法

仅使用flex是什么:

<View style={{flex: 0.2,backgroundColor: 'white',flexDirection: 'row',justifyContent: 'space-evenly'}}>
    <Pressable style={{flex: 1}}>
        <Image style={{flex: 1}} resizeMode="contain" source = {require('../../DataStorage/SymbolsPicture/arrowLeft.png')}/> 
    </Pressable>
    <Pressable style={{flex: 1}}>
        <Image style={{flex: 1}} resizeMode="contain" source = {require('../../DataStorage/SymbolsPicture/arrowRight.png')}/> 
    </Pressable>
</View> 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。