<!--index.wxml-->
<scroll-view scroll-y style= "height:1000rpx; width: 2000rpx; display:flex; flex-direction: row;" >
<view wx:for="{{t}}" wx:for-item="t" src="{{t}}" style=" width: 250rpx; height: 250rpx;background:url('{{t}}');background-size:250rpx 250rpx; display:flex; flex-direction: row;">水果</view>
</scroll-view>
为什么我设置横向显示:flex-direction: row;无效呢?还多出了滚动条。
菜鸟问题,请多多指教!
网友回复:
<!--index.wxml-->
<scroll-view scroll-y style= "height:1000rpx; width: 2000rpx;" >
<image wx:for="{{t}}" wx:for-item="t" src="{{t}}" style=" width: 250rpx; height: 250rpx"></image>
<!-- <view wx:for="{{t}}" wx:for-item="t" src="{{t}}" style=" width: 250rpx; height: 250rpx;background:url('{{t}}');background-size:250rpx 250rpx; display:flex; flex-direction: row;">水果</view> -->
</scroll-view>
上面这段还代码就能横排
<!--index.wxml-->
<scroll-view scroll-y style= "height:1000rpx; width: 2000rpx;" >
<image wx:for="{{t}}" wx:for-item="t" src="{{t}}" style=" width: 250rpx; height: 250rpx"></image>
<view wx:for="{{t}}" wx:for-item="t" src="{{t}}" style=" width: 250rpx; height: 250rpx;background:url('{{t}}');background-size:250rpx 250rpx; display:flex; flex-direction: row;">水果</view>
</scroll-view>
、
view 控件是不能横排的吗