Stanford IOS7 Open Class 10 notes and Demo demo

Source: Internet
Author: User

This section focuses on serial queues in multi-threading and scrolling view Uiscrollview.

I. Multi-Threading

This section simply describes the multi-threaded serial queue, which is the sequential execution of the task by joining the thread queue.

(1) The current methods of iOS multithreading are mainly GCD and Nsoperation, the former is the C language level, the latter is encapsulated, more object-oriented features of the API.

(2) UI interaction is carried out in the main thread, so in order to ensure the process of the interactive process comfortable, similar to the download time-consuming operation is required to execute outside the main thread, otherwise the user will not be able to manipulate the phone scene.

At this point through multi-threading, you can download pictures and other time-consuming operations alone, complete and then callback the main thread, refresh the UI interface, so that the interaction process more smoothly. For more details, demo demo

two. Uiscrollview

Note that setting the contentsize, which is what the scrolling view shows, can be imagined as a canvas, the phone moving on the canvas, the contents of the canvas viewed through the screen, and the ability to zoom in and out of the canvas's content.

Note Set the scale maximum, minimum scale value, and the agent method "Viewforzoominginscrollview" to implement the scaling operation, otherwise the Uiscrollview scaling operation will not respond.

Three. Use the iOS-enabled wait-and-spin effect to make the interactive process more reasonable.

With the UI control Uiactivityindicatorview, tick enable animation and hide two effects after the download starts, the animation starts after the start of the animation, and when the task is finished, it stops and hides the control.

In addition, it is recommended that the control is set up in the document view, especially when the UI controls are more convenient, and you can see the yellow exclamation mark after using the automatic layout effect, which makes it easy to select the corresponding auto-correction action.

: (Demo:http://files.cnblogs.com/colinhou/Imaginarium.zip)

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.