Notes for flex clipcontent Programming

Source: Internet
Author: User


Now we need to perform the drag operation on C with the mouse. So that it can be moved freely in Area A, but since C is contained in Area B, it can only be moved in Area B when startdrag () and stopdrag () are used, but cannot exceed the boundary of B.
If we want C to move in a, we should use an attribute named clipcontent.

The following is the definition of this attribute:
Whether to apply a clip mask if the positions and/or sizes of this container's children extend outside the borders of this container.

Its Chinese meaning is roughly:
Whether to apply a clipping mask if the position and/or size of the sub-item of the container expand beyond the border of the container.

Clipcontent value:
True: when the sub-project boundary exceeds this container, the sub-project is not displayed in this container.
Flase: when the sub-project boundary exceeds this container, the sub-project is displayed in this container.

Clipcontent is a public propertie in the iner. Therefore, some container controls commonly used in Flex are as follows:
This attribute can be used by accordion, box, canvas, form, formitem, layoutcontainer, panel, tile, and viewstack.

That is, in B, we set clipcontent = false to achieve the desired effect. When C is moving, if D is encountered, it will be under D. What is the problem?
Because in the coding structure, the Z-index of D is higher than that of B, so when C moves, it will be blocked by D (although C can be moved anywhere in)

So let's make the following settings:
Place the Z-index of B on the Z-index of D. The method we use is setchildindex (this method is very common, so I will not repeat it here .)

Therefore, in a complicated nested container, if you want to move one of the sub-containers in the outermost container, you should make the following settings:
1. The parent container of the sub-container to be moved (of course there may be parent containers on top of this parent container) should be displayed at the top of the container to be moved.
Example: A → B → C → D → e
F → G → H
If you want to move e to A, you need B to be on F, that is, use setchildindex to reset the positions of B and F.
2. Set clipcontent of the d container to false.

Above, I hope it will be helpful to you :)

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.