A peculiar problem of masonry uiscrollview AutoLayout

Source: Internet
Author: User

The thing is this ....

I have been used in a project masonry do AutoLayout, there is a gesturerreconizer bug, looking for a long time, found very strange a phenomenon:

One of my view is like this.

|--------------------------------------|

| Uiviewcontroller.view |

|    |----------| |--------------------|

| |    uiview1-| | Uiscrollview |

|    |----------|                          | |

|  |    |-------------| |

|  | |    UIView2 | |

|  |    |-------------| |

| |--------------------|

|------------------------------------------

Uiscrollview's Contentview was omitted.

Supposedly, I should add view2 to Uiscrollview, but I accidentally wrote it wrong and added it to the outermost view:

[Self.view  addSubview:self.view2];

And then added a number of constraint

[Self.view2 makeconstraints:^ (Masconstraintmaker *make) {        make.top.equalTo (self.orderSectionView.bottom). offset (+);        Make.height.equalTo (@200);        Make.left.and.right.equalTo (_rightdownscrollcontentview);   }];

The key is, at first, everything went well, ran successfully!!!! The location is also right, as I add it into the ScrollView, but also can slide!!

But I use the original addconstraint:xxx option will have a lot of unsatisfied constraint msg produced ...

But this view2 of tap event handling has been problematic.

Two understanding:

1. Although the view hierarchy is not correct, but the constaint is satisfied, when the scroll, its dependent view position has changed, so it follows the slide

2. System Bug

  

A peculiar problem of masonry uiscrollview AutoLayout

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.