What is the use of movableview components in Wechat development
Editor to share with you about the use of movableview components in Wechat development, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!
The view component movable-view, which needs to be used with movable-area. Simply put, it is a container that supports dragging content within a specified area. Let's look at a simple example:
Interface
We use movable-area to set a draggable area of 200x200 size (red), and then place a 50x50-sized draggable content movable-view (blue) in this area. The direction of this draggable content is set to all, indicating that it can be dragged in any direction.
Drag demo
In fact, you can put more than one movable-view in a movable-area tag. It supports the placement of multiple movable-view. See the following example:
Interface 2
Drag Demo 2
The direction property of movable-view supports the following four values:
All-drag in any direction
Vertical-drag vertically
Horizontal-drag horizontally
None-cannot drag
The first three values are easy to understand. If direction is set to the last none, it can only be positioned in the movable-area by setting the value of the XMagne y property:
As soon as this code runs, the blue movable-view is displayed in the location (50pc50):
These are all the contents of this article entitled "what is the use of movableview components in Wechat development?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!