(Android Study Notes) Android View

Source: Internet
Author: User

(Android Study Notes) Android View

Android View class:

1. All Android components are subclasses of View.

2. All components can be configured in either of the following ways. Second, configure it through XML.

TextView class:

1. For text components, the main purpose is to statically display some text, similar to the label function.

2. It is a direct subclass of the android. widget. TextView class.

3. How to insert a hyperlink:

1) In the TextView component configuration in the XML file, write: android: autoLink = "all. Note: The symbols must be in English.

2) write the following in the Activity:
String html + ="Contact me anytime"; CharSequence charSequence = Html. fromHtml (html); textView1.setText (charSequence); textView1.setMovementMethod (LinkMovementMethod. getInstance ());

The textview1 is a hyperlink.


Style Sheet files:


There may be many components in Android. It is very troublesome to configure them one by one. Therefore, we can use the style sheet file for one-to-one configuration. Saves effort in development and maintenance.

Generally, the style sheet file is saved in the values folder under the res folder of the project. The file is style. xml.

Definition method:

    
  
 

Its reference is referenced by the name defined in name.


Definition:

Resources xmlns: android = "http://schemas.android.com/apk/res/android">

Reference:

 


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.