Android Development Learning Diary Day3--textview,editview,imageview

Source: Internet
Author: User

Today we have learned some of the ways to use controls, including Textview,editview,imageview

1.TextView, output a text chant

The main attributes are

Android:id logo

Android:layout_width width

Android:layout_height height

Android:text text content

Android:textsize Text Size

Android:textcolor text color

Android:background background

2.EditView, enter a text

The main attributes are the same

In addition there are

Android:hint input Hint text

Android:inputtype Input Text Type

Here's the Hint property, unlike the Text property used in EditView

Simply put, if you set hint or text to "123"

When you enter "456"

Hint to "456"

And the text is "123456"

3.ImageView, a space for displaying pictures

property is almost

Another android:src image source

Two points to note here

1) Android:layout_width has three more special values

  Match_parents: Enlarges the control so that it fills up all the space of its parent unit

Wrap_content: Expand controls based on content

Fill_parents: Rarely used after similar API2.2 to Match_parents

2) The difference between SRC and background

When you use SRC and background to load a picture at the same time

  SRC does not fill the entire space, does not stretch according to the space size, background instead

Above

Android Development Learning Diary Day3--textview,editview,imageview

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.