1. Display text control TextView
Property Name Description Android:text set the display text. Android:textsize set the text size, the recommended unit of measure "SP", such as "15SP" Android:textstyle set glyph [Bold (bold) 0, Italic (italic) 1, bolditalic (and Coarse and oblique) 2] You can set one or more, with the "|" Separates android:gravity sets the text position, as set to "center", and the text is centered. Android:hint text is displayed when empty, you can set the color of the hint information by Textcolorhint. This property is used in EditView, but can also be used here. Android:height sets the height of the text area, supports the measurement: px (pixels)/dp/sp/in/mm (mm) android:maxheight sets the maximum height of the text area Android:minheight Sets the minimum height of the text area Android:width sets the width of the text area, supports the measurement unit: px (pixels)/dp/sp/in/mm (mm), and the difference between the layout_width look here. Android:maxwidth set the maximum width of the text area Android:minwidth set the minimum width of the text area Android:textcolor set the text color Android:textcolorhighlig HT is the background of the selected text, the default is blue Android:textcolorhint set the color of the message text, the default is gray. Used in conjunction with hint. Android:textcolorlink the color of the text link. Android:capitalize set the English letter capitalization type. Android:digits sets which characters are allowed to be entered. such as "1234567890.+-*/%\n ()" Android:shadowcolor specifies the color of the text shadow, which needs to be used with Shadowradius. Effect: Android:shadowdx sets the start position of the shadow's horizontal coordinates. Android:shadowdy sets the start position of the shadow vertical coordinates. Android:maxlength limits the length of text that is displayed, and the excess portion is not displayed. Android:lines sets the number of lines of text, two lines are displayed, even if the second row has no data. Android:maxlines sets the maximum number of lines of text to display, in combination with width or layout_width, beyond the partial wrap, and the number of lines beyond will not be displayed. Android:minlines sets the minimum number of lines of text, similar to lines. Android:editorextras sets the additional input data for the text. discussed again in EditView. Android:ellipsize sets how the control is displayed when the text is too long. The following values are set: "Start"-the ellipsis is displayed at the beginning; "End"-the ellipsis is displayed at the end; "Middle"-the ellipsis is displayed in the middle; "Marquee"--displayed in the form of a marquee (animation moves Sideways)
2. Edit Text Control EditText
Android:hint= "Please enter a number! "//Set the information displayed on the Space android:numeric=" integer "//settings can only enter integers, if the decimal is: decimalandroid:singleline=" true "//Set single-line input, once set to True , the text is not wrapped automatically. Android:password= "true"//Set only enter password Android:textcolor = "#ff8c00"//Font Color android:textstyle= "bold"//font, bold, italic, Bolditalicandroid:textsize= "20dip"//Size android:capitalize = "characters"//write in uppercase Android:autotext//auto spell help Android: Capitalize//Initial capital Android:digits//set to accept only certain numbers android:singleline//whether a single line or multiple lines, enter is to leave the text box or text box to add a new line Android:numeric// Only accept Digital Android:phonenumber//Enter phone number android:editable//IS editable
The InputType property plays an important role in the style of the virtual keyboard that is launched when EditText input values android:inputtype= "phone"//Phone number android:inputtype= "Textcapcharacters "//Letter Capital Android:inputtype=" Textcapwords "//First uppercase android:inputtype=" textcapsentences "//Only first letter capitalized
Android:inputtype= "Texturi"//url android:inputtype= "textemailaddress"//email address
Android:inputtype= "Textemailsubject"//email subject android:inputtype= "Textpersonname"//Name android:inputtype= " Textpostaladdress "//Address Android:inputtype=" number "//Digital Android:inputtype=" numbersigned "//Signed number format Android:inputtype = "Numberdecimal"//floating-point format with decimal point android:inputtype= "datetime"//Time Date android:inputtype= "date"//Date keyboard android:inputtype= " Time "//Timing keyboard
3. Pushbutton button
The android:layout_width represents the width of the control, Wrap_content, Match_parent, and the specific value, and the length in dp;android:layout_height indicates the height of the control, Wrap_content, Match_parent, and the specific value, the length unit is dp;android:text the text to be displayed on the button android:textsize the font size to display on the button Android:textcolor The color of the font to be displayed on the button android:padding set the padding android:drawableTopandroid:drawableBottomandroid:drawableLeftandroid: Drawableright these four values represent the introduction of the picture, and the picture and the text-arranging rules android:background the background color of the button or the background picture (that is, you can pick up the picture, and you can connect the color value)
4. Common Layout Properties
The property value is true or falseandroid:layout_centerhrizontal horizontally centered android:layout_centervertical vertically centered Android:layout_ Centerinparent is completely centered relative to the parent element Android:layout_alignparentbottom snaps to the bottom edge of the parent element Android:layout_alignparentleft snaps to the left edge of the parent element Android:layout_alignparentright snaps to the right edge of the parent element Android:layout_alignparenttop snaps to the top edge of the parent element android:layout_ alignwithparentifmissing if the corresponding sibling element is not found, then the reference name of the parent element//attribute value must be an ID referring to "@id/id-name" Android:layout_below under an element of Android: Layout_above above an element android:layout_toleftof on the left side of an element android:layout_torightof to the right of an element android:layout_aligntop The top edge of this element and the top edge of an element are aligned android:layout_alignleft the left edge of this element and the left edge of an element are aligned android:layout_alignbottom the bottom edge of this element and the bottom edge of an element Android:layout_alignright the right edge of this element and the right edge of an element align//attribute value to a specific pixel value, such as 30dip,40pxandroid:layout_marginbottom distance from the bottom edge of an element Android:layout_marginleft distance from the left edge of an element android:layout_marginright the distance from the right edge of an element android:layout_margintop the distance from the top edge of an element
Android Development Smart Car app (1)---Android Controls and properties