ios8.x Uicollectionview Using item's Estimated row height problem

Source: Internet
Author: User

Apple introduced the item's estimated line height feature in iOS8.0 to accommodate the size of the dynamic calculation item:

@property (nonatomic) cgsize estimateditemsize ns_available_ios(8_0); //defaults to cgsizezero-setting a Non-zero size enables cells that self-size Via-preferredlayoutattributesfittin Gattributes:

use Estimateditemsize to implement-preferredlayoutattributesfittingattributes in custom item : method Dynamically calculates the size of item.

Tested under the 8.1,8.2 system, if the project is integrated with other third-party SDKs, using this method will only appear Libc++abi.dylib:terminate_handler unexpectedly threw an exception error, Global breakpoint cannot be located in the wrong place, if no third-party SDK is used, this error will be reported

Rewrite the pipelining layout, rewrite the layoutattributesforelementsinrect: method, print the returned layout properties, find that it is empty, find the reason, is in the 8.1,8.2 system, use the estimated row height, the custom item in the - Preferredlayoutattributesfittingattributes: It is not called, this could be a bug in the system.

ios8.x Uicollectionview Using item's Estimated row height problem

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.