![]() Of course there are more attributes, where you can find them in the TextView of the android doc. The available choices are web, email, phone, map or all of them. autoLink: identifies the links into the text and converts them into clickable ones.clickable: indicates if the view reacts to click events.lines: defines the exact height of the TextView in lines.This attribute can be used in order to allow copy-paste controls. textIsSelectable: indicates whether the text can be selected (true) or not (false).textColorHighlight: defines the color when the text is marked as highlighted.Again the color should be defined in hex encoding or as a reference to another resource. background: sets the background color of the text.The color has to be defined in hex encoding or as a reference to another resource. textColor: sets the color of the text.It is recommended to use sp for the size. textSize: defines the size of the text.The possible values are normal, sans, serif and monospace. typeFace: as you can imagine it defines the typeface for the text.fontFamily: specifies the font family for the text.The possible choices are bold, italic and normal. textStyle: sets the style of the text.text: defines the text that would be displayed on the screen.It is worth to mention that the respective functions exist too, so we can call them in the activity source code in order to change the characteristics of the view. Now lets explain the code above and the specific attributes that we defined in the XML file. Open res/layout/main_activity.xml, go to the respective xml tab and paste the following. ![]() In this example we are going to create a simple UI, that includes only TextView with different attributes. ![]() Now that the project is created, you can see the final structure of the project in the image below.ΔΆ. xml file for the layout will automatically be created in the res/layout folder. You have to specify a name for the new Activity and a name for the layout description of your app.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |