(Ios Development Study Notes) custom UIScrollView

Source: Internet
Author: User

Effect:

Brief description of implementation process:

1. Create a data item control, 2. Create a custom scroll view control, 3. Create a form to load a scroll view control.

 

Specific implementation:

1. Create a data item Control

Inherit UIView

View section:

 

Control implementation:

Note: You must load the nib file in init. Otherwise, the interface cannot be loaded correctly.

2. Custom UIScrollView Control

Implement the layoutSubViews method in the custom control:

Note: This method is called after the control captures touch events. If you load the Control repeatedly, it will cause memory overflow. If the child control in the control does not change, you do not need to reload it.

Set the content size of ScrollView

 

3. Form-loaded scroll Control

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.