Android development tips -- remove the autolink underline in TextView and textviewautolink
We know that the autolink and its type of textview are set in the layout file. The color of the link is displayed on the textivew, and there is an underline in the text to indicate that you can click. When we click textview, the application will jump to the corresponding in
The autoLink attribute of TextView provides us with great convenience. When there is a URL, email address, or phone number in the text, it makes it easy for us to call and send emails, but there are also some problems, for example, if you set autoLink to include the email attribute, you can call the email client to send an email when you click an email address in the text. However, if no email client is ava
accept numbers
Android: phonenumber // enter the phone number
Android: editable // whether to edit
Android: autolink = "all" // sets the text hyperlink style. When a URL is clicked, it jumps to the URL.
Android: textappearance = "? Andr
Path to Android Development 7-UI component 2
Today, we continue to learn about the UI components, mainly including TextView and EditText.
TextView component introduction:
Subclass:
Button, CheckdTextView, Cheronometer, DigitalClock, EditText
Indirect subclass:
AutoCompleteTextView, CheckBox, CommpoundButton, MultiAutoCompleteTextView
In its xml file, there are many attributes mentioned today, for example:
Android
The seventh day of Android
Textview and edittext
Textview:
Android: application of the autolink attribute
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: Id ="@ + ID/autotx"
the cursor to the last line Android: AutoText // automatically spell help Android: Capitalize // The first letter uppercase Android: digits // set to only accept certain numbers Android: singleline // whether a single line or multiple lines are supported. Press enter to leave the text box or Add a new line
Figure Description: Moving, backup after the launch of Android virtual machine appears
Solution to the problem of panic:could not open D:\java2\android\android-sdk-windows\.android\avd\test.ini
A few days ago, I am sorting some files, the previously installed on the Android
: editable // whether to edit
Android: autolink = "all" // sets the text hyperlink style. When a URL is clicked, it jumps to the URL.
Android: textappearance = "? Android: ATTR/textappearancelargeinverse "// text appearance. Here, it refers to a built-in appearance of the system ,? Indicates whether the system has this
: editable // whether to edit
Android: autoLink = "all" // sets the text hyperlink style. When a URL is clicked, it jumps to the URL.
Android: textAppearance = "? Android: attr/textAppearanceLargeInverse "// text appearance. Here, it refers to a built-in appearance of the system ,? Indicates whether the system has this
or Add a new line in the text box.
Android: numeric // only accept numbers
Android: phoneNumber // enter the phone number
Android: editable // whether to edit
Android: autoLink = "all" // sets the text hyperlink style. When a URL is clicked, it jumps to the URL.
1. TextView control Overview
The TextView control can be used to display text information (including HTML text). You can manually set it to editable or uneditable. In main. xml, add the TextView configuration section to create, design basic attributes, width, height, color, font size, etc.
2. Common attributes of TextView controls
Android: autoLink: sets whether the text is displayed as a clickable link whe
Directory (?) [-]
TextView
Example 1 Setting the Autolink property in XML
Example 2 Setting the Autolink property in code
EditText
Autocompletetextview
Multiautocompletetextview
TextViewTextView has been used a lot before, direct display, relatively simple. But we can with the "Autolink" attribute, so that users can c
the spaceAndroid: Numeric = "integer" // you can only enter an integer. If it is a decimalAndroid: maxlength = "8" // The maximum input length is 8.Android: singleline = "true" // you can specify a single-line Input. If this parameter is set to true, text is not automatically wrapped.Android: Gray = "TOP" // in multiple rows, the pointer is at the first position of the first row, ET. setselection (ET. Length (); // adjust the cursor to the last rowAn
Android: autoLink: determines whether the text is displayed as a clickable link when the text is URL link, email, phone number, or map. Optional values (none/web/email/phone/map/all)
Android: autoText if set, the spelling of the input value is automatically corrected. There is no effect here. It works when the input method is displayed and entered.
Android APIThe Chinese Document EditText is the content to be introduced in this article, mainly to understand and learnAndroid APIDocumentation help, detailsAndroid APIFor more information, see this article.
I. Structure of Android APIs
java.lang.Object
android.view.View
android.widget.TextView
android.widget.EditText
Known direct subclass:
AutoCompleteTextView,ExtractEditText
Known
Android APITextView is the content to be introduced in this document.Android APIThe content of this document.Android APIFor more information about this document, see this article.
Like the gadgets in a mechanical City game, every widget is a useful tool in our hands. Due to time issues, we can learn its basic usage for the moment, however, you only need to learn it from the system at a time. At least you need to know that there is such an attribute an
description in EditView, no effect here.Android: linksClickableSet whether to click the connection even if autoLink is set.Android: marqueeRepeatLimitWhen ellipsize specifies marquee, it sets the number of repeated scrolling times. When it is set to marquee_forever, it indicates unlimited times.Android: EMSSet TextView width to N characters. The test here is a Chinese character width.
Android: maxEmsSet th
resorting to other classes.
An easier way to do this is to add Autolink to the TextView XML layout, which is easiest to do, but cannot modify the style:
Second, Spannable Way
After the android:autolink= "Email|phone|web" is set in the XML, there is an underscore underneath the URL text, and we can see the source code of the class Clickablespan class inherited by Urlspan, as follows:
Public abstract class Clickablespan extends
// whether to editAndroid: autoLink = "all" // sets the text hyperlink style. When a URL is clicked, it jumps to the URL.Android: textAppearance = "? Android: attr/textAppearanceLargeInverse "// text appearance. Here, it refers to a built-in appearance of the system ,? Indicates whether the system has this appearance. Otherwise, the default appearance is used. I don't know, do you?Attribute Name Descriptio
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.