Android attributes collection by individuals Android: visibility

Source: Internet
Author: User

This attribute indicates whether the view is displayed. For example, Android: visibility = "gone" in relativelayout"

It has three attributes: visvisible display; invisvisible display black background entries; gone not display

In the class, you can set whether it is displayed or not, setvisibility (view. Gone); Not Displayed

Setvisibility (view. Visible); Display

Android edittext

1. onclick event of edittext
After an onclick event is added to edittext, if no focus is obtained, the first click will not respond, but the focus will be obtained. The second click will respond to onclick. There may be different solutions for unnecessary situations. Generally, onfocuschangedlistener is used, or the two are combined for event processing to achieve the expected results.

2. Hide the cursor and mask the keyboard
Setting edittext to hide the cursor may often be related to setting itNot editableUsed together. If the setting is not editable, you only need to setAndroid: editable = "false", And setInvisible cursorYou can set Android: cursorvisible = "false ".
If not, create the following method in the relevant Java class:Private void setedittextdisable () {<br/> et_name.setenabled (false); <br/> et_mobilephone.setenabled (false); <br/>}< br/>
With the hidden cursor, software disks may often be shielded. To achieve this function, you can set the inputtype parameter to type_null. However, during my experiment, I found that setting in the layout file does not work, to obtain the response component in the activity file, call setinputtype (inputtype. type_null) method.

3. Password
Edittext has an attribute: Android: password. The optional values are true and false. This attribute can mark whether the characters in the input box are replaced by dots. Note that after setting Android: Password = "true", you can press enter to enter the edittext. If you enter the press ENTER character, it will be treated as a character of the password, therefore, if such special characters are not allowed in the password, set singleline = "true ".

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.