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"
<Textview
Android: Id ="@ + ID/tvweburl"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: autolink ="Web"/>
<Textview
Android: Id ="@ + ID/tvemail"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: autolink ="Email"/>
<Textview
Android: Id ="@ + ID/tvphone"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: autolink ="Phone"/>
<Textview
Android: Id ="@ + ID/tvmap"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: autolink ="Map"/>
<Textview
Android: Id ="@ + ID/tvall"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: autolink ="All"
Android: text ="My blog: http://blog.csdn.net/jiahui524. Phone number: 15580974038. Email: 272570596@qq.com"/>
Private voidFindviews (){
Textviewtvweburl = (textview) findviewbyid (R. Id.Tvweburl);
Tvweburl. settext ("Netease: http://www.163.com ");
Textviewtvemail, tvphone,Tvmap, Tvhtml;
Tvemail = (textview)This. Findviewbyid (R. Id.Tvemail);
Tvphone = (textview)This. Findviewbyid (R. Id.Tvphone);
Tvmap = (textview)This. Findviewbyid (R. Id.Tvmap);
Tvhtml = (textview)This. Findviewbyid (R. Id.Tvhtml);
Tvemail. settext ("my mailbox: drinkeye@163.com ");
Tvphone. settext ("My number: 500000 ");
Tvhtml. settext (HTML.Fromhtml("<Font size = '33' color = '#333333'> I <I> love </I> North </font> jingtian <B> An </B> /n <br/> "+
"<Ahref = 'HTTP: // www.163.com '> 163 </a> "));
}
About 9 Patches
It is a tool for processing PNG images. It can generate a "* .9.png" image for us;
The so-called "* .9.png" is a special image format supported by Android OS. It can be used for partial stretching. This image has been specially processed by "9 Sisters, if it is not processed, the direct use of the PNG image will be distorted and the stretching will not work properly.
Edittext
Use of the carriage return key in edittext
<Edittext
Android: Id ="@ + ID/text1"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: text ="Text1"/>
<Button
Android: Id ="@ + ID/button1"
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: visibility ="Gone"
Android: text ="Button"/>
Et. setonkeylistener (This);
...
Public BooleanOnkey (view,IntKeycode, keyevent event ){
If(Keycode = keyevent.Keycode_enter){
BTN. settext (ET. gettext ());
Et. setvisibility (view.Gone);
BTN. setvisibility (view.Visible);
}
Return true;
}
Enter a specific character
<Edittext
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: Password ="True"
Android: digits ="01234"/>
<Edittext
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: digits ="ABCD"/>
<Edittext
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: inputtype ="Number"/>
<Edittext
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: inputtype ="Textemailaddress"/>
<Edittext
Android: layout_width ="Fill_parent"
Android: layout_height ="Wrap_content"
Android: Numeric ="Decimal | signed"/>