Simple learning experience: NetEase Cloud Classroom Android Development Chapter III custom controls

Source: Internet
Author: User

This chapter is divided into three parts:

(1) Custom control: The teacher first briefly explained some details, such as why not PX, and to use DP, only because of the screen resolution of different models, with PX will lead to the difference is too large. Then we demonstrate the steps to make a custom control by first adding the corresponding custom view class to the XML file and giving the canvas size, And then OnDraw in. Java, it's worth noting that the coordinates in OnDraw are relative to the canvas (as defined in XML), so it's easy to have a problem by drawing a view with specific values.

(2) Fragment: The 1th is the two methods of setting Fragment. The first is in the. xml file, which is statically set, not interactive, and the second is set in. Java and can be interacted with. The 2nd is Fragment life cycle, and activity is similar, just fragment to more than a few stages, and fragment is dependent on activity, from the log can be seen.

(3) Handler: Use the message delay to send information, Handler processing information, modify TextView, create a timing effect.

Simple learning experience: NetEase Cloud Classroom Android Development Chapter III custom controls

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.