当前位置:网站首页>uniapp中scroll-view的坑
uniapp中scroll-view的坑
2022-07-25 08:47:00 【丫霸902】
1.scroll-view为scroll-x="true"时
(1)scroll-view中的子元素,不能使用浮动float
(2)scroll-view中外层容器使用display:flex是无效的
(3)若想实现flex横向效果,请将需要滑动的子元素设置为display:inline-block并为其设置宽高
(4)外层容器添加属性 overflow:hidden;white-space:nowrap;
html代码
<scroll-view scroll-x="true" class="limit-act-con">
<view class="act-img" v-for="(item,index) in list3" :key="index">
<img :src="item" alt="">
</view>
</scroll-view>style代码
.limit-act-con {
overflow:hidden;
white-space:nowrap;
.act-img {
display: inline-block;
margin-right: 16rpx;
dislay:inline-block;
img {
width: 332rpx;
height: 160rpx;
border-radius: 20rpx;
}
}
}2.scroll-view为scroll-y="true"时
只需设置好外层容器的高度
边栏推荐
- LeetCode·83双周赛·6129.全0子数组的数目·数学
- 这是我见过写得最烂的Controller层代码...
- Rstudio shows that it can't connect to the web page, or it has a new website.
- Unity client reading text configuration
- Redis learning
- 51 MCU internal peripherals: timer and counter
- Arcgis10.2 installation tutorial
- 51单片机内部外设:定时器和计数器
- Basis 33: XPath acquisition methods of page elements under various browsers
- @Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
猜你喜欢

【芝麻街一家】& Bert Bart RoBERTa

Graduation project of wechat small program ordering system of small program completion works (4) opening report

25 Ph.D. degrees revoked

Wechat reservation applet graduation design of applet completion works (2) applet function

为什么要使用MQ消息中间件?这几个问题必须拿下!

Huawei device remote login (Telnet, SSH) configuration

016 fundamentals of machine learning mathematics: Introduction

Recursive call to print every bit of an integer

51单片机外设篇:蜂鸣器

When testing VPN, the IP found by the command line is inconsistent with that of Baidu search
随机推荐
Keep your Eyes on the Lane: Real-time Attention-guided Lane Detection
51 single chip microcomputer controls nixie tube display
Unity client reading text configuration
Qt|qlabole change line spacing when displaying multiple lines
公寓报修系统(IDEA,SSM,MySQL)
[graduation project] cinema booking management system based on micro Service Framework
Redis learning
机器人跳跃问题
Freemaker template engine
51单片机内部外设:串口通信
Review the second time, 220614, video, day03_ Data warehouse design,
@Differences between requestparam, @pathparam, @pathvariable and other annotations (use of some annotations)
DIY can decorate the mall system, you can also have!
unity客户端读取文本配置
为什么要使用MQ消息中间件?这几个问题必须拿下!
51 MCU internal peripherals: timer and counter
[dark horse programmer] redis learning notes 004: master-slave replication + sentinel mode + cluster
Yolov5 environment configuration
Wechat reservation applet graduation design of applet completion works (3) background function
Idea reads configuration files such as validationmessages.properties Chinese garbled