WeChat applet (9) scroll-view component details, Applet scroll-view

Source: Internet
Author: User

Applet (9) scroll-view component details, Applet scroll-view

Scroll-view is a rolling view, divided into horizontal and vertical scrolling. Note that you must set the height when scrolling the view vertically. Otherwise, scroll-view will not take effect. The commonly used items in a rolling view are interfaces with many items, such as my module.

Main attributes:

Demo:

Wxml

<! -- Vertical scroll. The height must be set here --> <scroll-view scroll-y = "true" style = "height: 200px"> <view style = "background: red; width: 100px; height: 100px "> </view> <view style =" background: green; width: 100px; height: 100px "> </view> <view style =" background: blue; width: 100px; height: 100px "> </view> <view style =" background: yellow; width: 100px; height: 100px "> </view> </scroll-view> <! -- White-space normal: normal (default processing method. text automatically processes line breaks. if the content arrives at the container boundary, it will go to the next line. pre: Keep spaces and line breaks in the HTML source code, which is equivalent to the pre label nowrap: force the text in one line, unless the br line feed label pre-wrap: Same as the pre attribute, the pre-line is automatically wrapped when the pre attribute is exceeded the container range, however, consecutive spaces are considered as a space. inherit: inheritance --> <! -- Horizontal scroll --> <scroll-view scroll-x = "true" style = "white-space: nowrap; display: flex"> <! -- Display: inline-block --> <view style = "background: red; width: 200px; height: 100px; display: inline-block "> </view> <view style =" background: green; width: 200px; height: 100px; display: inline-block "> </view> <view style =" background: blue; width: 200px; height: 100px; display: inline-block "> </view> <view style =" background: yellow; width: 200px; height: 100px; display: inline-block "> </view> </scroll-view>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.