Android layout properties, Tag Properties Summary

Source: Internet
Author: User

Relativelayout First Class: attribute value true to Falseandroid:layout_centerhrizontal         Center horizontally android:layout_centervertical          vertically centered Android:layout_ Centerinparent          fully centered relative to 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_ alignwithparentlfmissing if the corresponding sibling element cannot be found, the parent element is the reference. Second class: The attribute value must be the reference name of the ID android:layout_below           below an element of Android: Layout_above           above an element android:layout_toleftof          on the left side of an element android:layout_torightof       on the right side of an element android: Layout_aligntop        aligns the top edge of this element with the top edge of an element android:layout_alignleft        The left edge of this element is aligned with the left edge of an element android:layout_alignbottom     the bottom edge of this element and the bottom edge of an element are aligned android:layout_alignright        the right edge of this element and the right edge of an element are aligned with the third class: attribute values are specific pixels on duty, such as 30dipandroid:layout_marginbottom     The distance from the bottom edge of an element android:layout_marginleft       the distance from the left edge of an element android:layout_marginright      distance from the right edge of an element android:layout_margintop      distance from the top edge of an element android:hint            set the EditText to be entered when empty android:gravity          Limit the view content: up and down android:layout_gravity= "right" is used to set the container (component) on the left side Android:text    The text displayed in the specified control   use the string in the String.xml file as much as possible android:textsize    text size android:width      Control width android:height      control height android:layout_width Specifies the width of the container component Android:layout_height Specifies the height of the container component view &NBsp;               Divide the space by proportion android:padding*               inner margin android:singleline   true, Content is displayed on the same line android:scaletype:   control how the picture resized/moved to match ImageView's sizeimageview.scaletype/ Android.scaletype value difference: Center/center by the original size of the picture is displayed, when the picture is longer than the width of the view, the center portion of the captured picture is displayed Center_crop/centercrop Scale the size of the image to the center display, so that the length of the picture is equal to the width of the view center_inside/centerinside the picture contents of the full center display, by reducing the ratio or the original size so that the picture length is equal to or less than the width of the view fit_ Center/fitcenter   Zoom In/out to view width, center display fit_end/fitend        enlarge image proportionally Zoom out to the width of the view, centered in the lower position of the view Fit_start/fitstart     Zoom in/out to the width of the view, centered in the upper position of the view Fit_xy/fitxy          display the picture without proportional   expand/shrink to view size Matrix/matrix         Use a matrix to plot, zoom in and out to display the magnified image dynamically. Android:interpolator   Control Animation Progress (Alpha scale translate rotate) Android offers several interpolator subclasses that achieve different speed curves, The following acceleratedcelerateintErpolator     at the beginning of the animation with the introduction of the place the rate is slower, and then start to accelerate Cycleinterpolator    animation loop to put a specific number of times, The rate changes along the sinusoidal decelerateinterpolator   at the beginning of the animation at a slower rate, then starts to slow down linearinterpolator     At an even rate of animation changes android:screenorientation= "Portrait" specifies that the screen for portrait screen android:screenorientation= "Landscape" specifies the screen as a horizontal screen for Android: Capitalize    set the English letter capitalization type android:cursorvisible   Sets whether the cursor is displayed android:digits    sets which characters are allowed to be entered. such as "123456&*" Android:drawablebottom: Output a drawable below the text. If the color is set to the background color android:drawableleft: Output A drawable to the left of text. Android:drawableright: Outputs a drawable to the right of text. Android:drawabletop: Outputs a drawable at the top of the text. Android:editable   Sets the additional input data for the text that can be edited Android:editorextras settings. Android:ellipsize settings when the text is too long, how the control is displayed, with the following properties the start ellipsis appears at the beginning  end ellipsis at the end of the  middle ellipsis in the middle      The marquee is displayed as a marquee (animated lateral movement) Android:ems set the width of the TextView to n characters android:freezestext set the contents of the saved text and the cursor built-in Android: Includefontpadding sets whether the text contains the top and bottom extra whitespace, by default Trueandroid:inputmethod specifies the input method for the text, requires a fully qualified name (full package name) Android:inputtype set the type of Guangxi, Used to help IME displayDisplay the appropriate keyboard type Android:lines set the number of lines of text displayed Android:linespacingextra set the line spacing Android:linespacingmultiplier set the multiple of the line spacing. If 1.3android:linksclickable sets the link whether to click the connection, even if set autolickandroid:marqueerepeatlimit   in ellipsize specified, set the repeat scroll count. When the Marquee_forever is set, the width of the Android:maxems setting TextView is set to the width of the maximum of n characters. When used in conjunction with EMS override EMS option Android:maxheight sets the maximum height of the text area android:maxlength limits the length of text that is displayed, and the excess portion is not displayed. 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:maxwidth sets the maximum width of the text area Android:minems sets the width of the textview to a minimum of n characters. Overwrite EMS option when used with EMS. Android:minheight sets the minimum height of the text area Android:minlines sets the minimum number of lines of text, similar to lines. Android:minwidth sets the minimum width of the text area Android:numeric if set, the TextView has a numeric input method. Android:password with a small dot "." Display text Android:phonenumber set as input for phone number Android:privateimeoptions set IME options android: scrollhorizontally If the text is set beyond the width of the TextView, the horizontal bar Android:selectallonfocus if the text is selectable, let him get the focus instead of moving the cursor to the beginning or end of the text. No effect after setting in TextView. ANDROID:SHADOWCOLOR Specifies the color of the text shadow, you need to use ANDROID:SHADOWDX with Shadowradius to set the start position of the shadow horizontal coordinates. Android:shadowdy sets the start position of the shadow vertical coordinates. Android:shadowradius sets the radius of the shadow. Set to 0.1It becomes the color of the font, generally set to 3.0 effect is better. Android:singleline sets the single-line display. If used with Layout_width, when the text cannot be displayed in its entirety, it is followed by "...". such as android:text= "Test_ singleline" adnroid:stretchcolumns in Tablelayout Specify the number of columns as stretching (when filling the screen) Android: The text setting displays texts. Android:textsize set text size, recommended unit of measure "SP" or "PT" Android:textstyle set glyph [Bold (bold) 0, Italic (italic) 1, bolditalic (coarse and oblique) 2] You can set one or more, with "|" Separate android:typeface set the text font, which must be one of the following constant values: normal 0, sans 1, serif 2, monospace (equal width font) 3android:width set width of text area, support unit of measure: px (pixels)/ DP/SP/IN/MM (mm), the difference with layout_width look here  ********************************************************************* *************************************************************************************************************** ***************************************************************************************************************  android Layout Properties Daquan (detailed version) layout: absolutelayout (absolute layout) : xmlns:android= "http://scmemas.android.com/apk/res/android" style= "@ ..." android:clipchildren= "True|false" Android:cliptopadding= "True|false" android:layoutanimation= "@---" android:animationcache= "True|false" Android: Persistentdrawingcache= "None|animation|scrolling|all": Continuous cache drawing android:alwaysdrawnwithcache= "True|false" Android : andstatesfromchildre= "True|false" android:descendantfocusability= "beforedescendants|afterdescendants| Blocksdescendants ": Descendants can focus android:id=" @+id/absolutelayout "android:tag=" @---"android:android:scrollx="---"Android : android:scrolly= "---" android:background= "@---" android:padding= "----" android:paddingleft= "----" Android: paddingtop= "----" android:paddingright= "----" android:paddingbotton= "---" android:focusable= "True|false" Android: Focusableintouchmode= "True|false" android:visibility= "Visible|invisible|gone" android:fitssystemwindows= "true| False ": For system window android:scrollbars=" none|horizontal|vertical "android:scrollbarstyle=" Insideoverlay (Inner overlay) | Insideinset (inset) |outsideoverlay (outer overlay) |outsideinset (outer inset) "android:isscrollcontainer=" True|false ": is a scrolling collection of Android: Fadescrollbars= "True|false": Faded scroll bar Android:scrollbarfadedurAtion= "---": Reel fades Android:scrolldefaultdelaybeforefade= "---": Default delay before scrolling android:scrollbarsize= "---" Android: Scrollbarthumbhorizontal= "@----": Thumb horizontal scroll bar android:scrollbarthumbvertical= "@----": Thumb vertical scroll bar android: Scrollbartrackvertical= "@---": Vertical scroll bar track android:scrollbartrackhorizontal= "@---": Horizontal scrollbar Track Android: scrollbaralwaysdrawhorizontaltrack= "True|false": the horizontal scrollbar always attracts the track android:scrollbaralwaysdrawverticaltrack= "true| False ": The vertical scrollbar always attracts the track android:fadingedge=" none|horizontal|vertical ": The Fading Edge android:fadingedgelength="---": Edge length Fading android:nextfocusleft= "----": lower left focus android:nextfocusup= "---": Next key Register android:nextfocusright= "---": Right next focus android:nextfocusdown= "---": Next focus Move Down android:clickable= "True|false": Click android:longclickable= "True|false" Android:saveenabled= "True|false": Enable Save Android:drawingcachequality= "Auto|low|hight": Drawing cache Quality android:keepscreenon= " True|false ": Keep screen android:duplicateparentstate=" True|false ": Repeat Parent State android:minheight="---": android:minwidth="----" : android:soundeffectenabled= "True|false": Sound enabled Android:hapticfeedbackenable= "TruE|false ": Haptic feedback enabled android:contentdescription=" @---": Content overview android:onclick=" @---": android:layout_gravity=" Top|bottom |right|left|center_vertical|center_horizontal|fill_vertical|fill_horizontal|center|fill|clip_vertical|clip_ Horizontal ": Gravity android:layout_width=" fill_parent|match_parent|wrap_content "android:llayout_height=" fill_parent| Match) parent_wrap_content "android:layout_margin=" ": android:layout_marginleft=" "android:layout_margintop=" " android:layout_marginright= "" Android:layout_marginbottom= ""  dialerfilter (Dialer filter):  expandablelistview (Extensible List View): Framelayout (Pin layout): GridView (grid view): Horizontalscrollview (horizontal scrolling view): Imageswither (Image toggle): LinearLayout (Linear layout):  listview (List view): Mediacontroller (Media Controller): Radiogroup (radio button Group): Relativelayout (relative layout): ScrollView (scrolling view): Slidingdrawer (Slide drawer): Tabhost (Tag host): Tabwidget (Label control): Tablelayout (Table layout): TableRow (table row): Textswitcher (text toggle): Viewanimator (view animation): Viewflipper (see Foley Cooper): Viewswitcher (View toggle):--------------------------------------------------- Gestureoverlayview (Gesture overlay view): Surfaceview (View): View (see): Viewstub (View stub): WebView (Web View): AnalogClock (Analog clock): Autocompletetextview (Auto-complete text view): button: CheckBox (check box): Checkedtextview (check text view): Chronometer (timepiece):D Atepicker (date selector):D Igitalclock (digital clock): EditText (edit text): Gallery (Gallery): ImageButton (image button): ImageView (Image View): Multiautocompletetextview (Multi-AutoComplete text view):P Rogressbar (Progress): Quickcontactbadge (Quick Contact badge): Radio button (radio button): Ratingbar (score bar): SeekBar (Search bar: Drag progress bar): Spinner (fine): TextView (text view): Timepicker (Time Picker): ToggleButton (toggle button): Twolinelistitem (two-line list item): Videoview (Video view): Zoombutton (zoom button): Zoomcontrols (Zoom control ): Include (included):-------------------------------(Consolidated): xmlns:android= "Http://schemas.android.com/apk/res/android" Android:layout_gravity= "top|bottom|left|right|center_vertical|fill_vertical|center_horizontal|fill_horizontal| Center|fill|clip_vertical|clip_horizontal "Android:layout_width=" Fill_parent|match_parent|wrap_content "Android: layout_height= "Fill_parent|match_parent|wrap_content" android:layout_margin= "" android:layout_marginlef= "" Android:layout_margintop= "" Android:layout_marginright= "" Android:layout_marginbottom= ""  ********************************************************** *************************************************************************************************************** ***************************************************************************************************************  android XML Properties Daquan EditText Property android:layout_gravity= The "center_vertical" setting control is displayed: Default top, centered here, and bottomandroid:hint= "Please enter a number! "Set the message displayed on the Space android:numeric=" integer "setting can only enter integers, if it is a decimal: decimalandroid:singleline=" true "to set the single-line input, once set to true, The text does not wrap automatically. Android:password= "true" setting can only enter password Android:textcolor = "#ff8c00" Font color android:textstyle= "bold" font, bold, italic, Bolditalicandroid:textsize= "20dip" size android:capitalize = "characters" in uppercase letters android:textalign= "center" EditText does not have this attribute, but TextView has android:textcolorhighlight= "#cccccc" is the background of the selected text, the default is blue android:textcolorhint= "#ffff00" Sets the color of the message text, which defaults to gray Android:textscalex= "1.5" controls the spacing between words and words android:typeface= "monospace" font, normal, sans, serif, monospaceandroid:background= "@null" space background, there is no , which refers to the transparent android:layout_weight= "1" weight, controls the position between controls, which is useful when controlling the size of the control display. Android:textappearance= "? Android:attr/textappearancelargeinverse" text appearance, here refers to the system comes with a look,? Indicates whether the system has this appearance, otherwise the default appearance is used. I don't know if I understand that, right?   is implemented by edittext the relevant properties in the layout XML file:    1. The Password Box property android:password= "True"   This allows EditText to be displayed automatically as an asterisk, and the content will become * within 1 seconds.   2. Pure Digital Android:numeric= "true" This allows the input method to automatically become a digital input keyboard, while allowing only 0-9 of the digital input   3. Allow only android:capitalize= "cwj1987" This allows only input cwj1987 to be accepted, generally for password authentication    Here are some extended style attributes   android:editable= " False "set EditText non-editable   android:singleline=" true "forces the input of the content in a single line   android:ellipsize=" End " Auto-hide trailing overflow data, typically used for long lines of text when the   textview property Android:autolink set whether the text is a clickable link when the text is a URL link/email/phone number/map. Optional value (none/web/email/phone/map/all) Android:autotext If set, the spelling correction of the input value will be performed automatically. There is no effect here, it works when the input method is displayed and entered. ANDROID:BUFFERTYPE Specifies the text category that is obtained by the GetText () method. Option editable similar to StringBuilder can beAppends a character, which means that the Append method can be called after gettext to set the text content. Spannable can use the   style in a given character area, see here 1, here 2. Android:capitalize set the English letter capitalization type. There is no effect here, you need to pop up the input method to see, see EditView this property description. Android:cursorvisible set cursor to show/hide, default display. Android:digits sets which characters are allowed to be entered. such as "1234567890.+-*/% ()" Android:drawablebottom in the text below the output of a drawable, slice. If you specify a color, the background of text is set to that color, and the latter is overridden when used with background. Android:drawableleft on the left side of the text output a drawable, slice. Android:drawablepadding sets the spacing between text and drawable (picture), used with Drawableleft, Drawableright, Drawabletop, Drawablebottom, Can be set to negative, no effect is used alone. Android:drawableright output a drawable to the right of text. The android:drawabletop outputs a drawable directly above the text. Android:editable whether the settings are editable. Android:editorextras sets the additional input data for the text. 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 appears at the end; Middle "--the ellipsis appears in the middle; Marquee "--display in Happy   light (animated lateral movement) Android:freezestext sets the contents of the saved text and the position of the cursor. Android:gravity set the text position, as set to "center", the text will be centered. Android:hinttext the text message that 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:imeoptions additional functions, set the action associated with the edit box in the lower right corner of the IME action, such as the lower right corner of the Actiondone will display a "done" instead of the default is a carriage return symbol. This in the EDITview in detail, this is useless here. Android:imeactionid Set the IME action ID. Android:imeactionlabel Set the IME action label. Android:includefontpadding sets whether the text contains extra white space at the top and bottom, which defaults to true. ANDROID:INPUTMETHOD specifies the input method for text and requires a fully qualified name (the full package name). For example: Com.google.android.inputmethod.pinyin, but the error is not found here. Android:inputtype sets the type of text that is used to help the input method display the appropriate keyboard type. Detailed in the EditView, there is no effect here. Android:linksclickable sets whether the link clicks the connection, even if Autolink is set. Android:marqueerepeatlimit sets the number of repetitions that are repeated when the ellipsize is specified marquee, when set to Marquee_forever. Android:ems sets the width of the TextView to n characters. Here the test for a kanji character width android:maxems Sets the width of the textview to a maximum of n characters. Overwrite EMS option when used with EMS. Android:minems sets the width of the textview to a minimum of n characters. Overwrite EMS option when used with EMS. 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:linespacingextra sets the line spacing. Android:linespacingmultiplier sets the multiple of line spacing. If the "1.2" Android:numeric is set, the TextView has a numeric input method. It is useless here, the only effect after setting is TextView has the click Effect, this property will be explained in detail in Edtiview. Android:password with a small dot "." Displays the text Android:phonenumber set as the input for the phone number. Android:privateimeoptiONS sets IME options, which are useless here, and will be discussed further in EditText. android:scrollhorizontally if the text exceeds the width of the TextView, the horizontal pull bar appears. Android:selectallonfocus If the text is selectable, let him get the focus instead of moving the cursor to the beginning or end of the text. No effect after setting in TextView. ANDROID:SHADOWCOLOR Specifies the color of the text shadow, which needs to be used with Shadowradius. ANDROID:SHADOWDX sets the start position of the shadow horizontal coordinates. Android:shadowdy sets the start position of the shadow vertical coordinates. Android:shadowradius sets the radius of the shadow. Set to 0.1 to become the color of the font, generally set to 3.0 effect is better. Android:singleline sets the single-line display. If used with Layout_width, when the text cannot be displayed in its entirety, it is followed by "...". such as android:text= "Test_ singleline" android:singleline= "true" android:layout_width= "20DP" will show only "t ...". If you do not set Singleline or set to False, the text wraps Android:text setting the display text. Android:textappearance set text outside. As "? Android:attr/textappearancelargeinverse" here refers to the system comes with a look,? Indicates whether the system has this appearance, otherwise use the default appearance. Can  textappearancebutton/textappearanceinverse/textappearancelarge/textappearancelargeinverse/ Textappearancemedium/textappearancemediuminverse/textappearancesmall/textappearancesmal linverseandroid: TextColor Set the text color android:textcolorhighlight 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:textscalex set the spacing between text, which defaults to 1.0f. Android:textsize set text size, recommended unit of measure "SP", such as "15SP" Android:textstyle set glyph [Bold (bold) 0, Italic (italic) 1, bolditalic (coarse and oblique) 2] You can set one or more, using the "|" Separate android:typeface set the text font, which must be one of the following constant values: normal 0, sans 1, serif 2, monospace (equal width font) 3]android:height Set the height of the text area, support unit of measure: px (pixels )/dp/sp/in/mm (mm) android:maxheight set the maximum height of the text area Android:minheight set the minimum height of the text area Android:width set the width of the text area, support unit of measure: px (pixels)/ DP/SP/IN/MM (mm), which differs from 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 layout properties, Tag Properties summary

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.