Android View Properties detailed

Source: Internet
Author: User
Tags border color

first, there are 8 direct sub-categories: AnalogClock, ImageView, Keyboardview, ProgressBar, Surfaceview, TextView, ViewGroup, Viewstub.


second, there are 54 indirect sub-categories: Abslistview, Absseekbar, Absspinner, absolutelayout, adapterview<t extends Adapter> Appwidgethostview, Autocompletetextview, Button, CheckBox, Checkedtextview, chronometer, Compoundbutton, DatePicker, Dialerfilter, DigitalClock, EditText, Expandablelistview, Extractedittext, Framelayout, Glsurfaceview, Gallery, Gestureoverlayview, GridView, Horizontalscrollview, ImageButton, Imageswitcher, LinearLayout, ListView, Mediacontroller, Multiautocompletetextview, Quickcontactbadge, RadioButton, Radiogroup, Ratingbar, RelativeLayout, ScrollView, SeekBar, Slidingdrawer, Spinner, Tabhost, Tabwidget, Tablelayout, TableRow, Textswitcher, Timepicker, ToggleButton, Twolinelistitem, Videoview, Viewanimator, Viewflipper, Viewswitcher, WebView, Zoombutton, Zoomcontrols


Third, attributes:


1) Android:background
sets the background color/background picture. You can set the background to transparent in the following two ways: "@android: Color/transparent" and "@null". Note that TextView is transparent by default and does not have to write this property, but Buttom/imagebutton/imageview would have to write this property if he wanted to be transparent.


2) android:clickable
whether to respond to click events.


3) Android:contentdescription
Set the note description for the view as an accessibility feature that provides instructions for some view without a text description, such as ImageButton. There is no effect on the interface, you control the program, you can temporarily put a bit of string data.


4) android:drawingcachequality
sets the translucent quality when drawing. The following values can be set: Auto (by default, as determined by the framework)/high (high quality, uses a higher color depth, consumes more memory/low (low quality, uses lower color depth, but with less memory).


5) Android:duplicateparentstate
If this property is set, the drawing state is obtained directly from the parent container (cursor, press inferior). Note that the current test situation is simply to get the drawing state, without getting the event, that is, when you click the LinearLayout button has a clicked effect, but does not perform a click event.


6) Android:fadingedge
sets the direction in which the border gradient is placed when the scrollbar is drawn. None (border color is not changed), horizontal (horizontal color is dimmed), vertical (vertical color is dimmed).


7) Android:fadingedgelength
sets the length of the border gradient.


8) Android:fitssystemwindows
whether to consider system windows (such as status bar) when setting layout adjustments


9) android:focusable
sets whether to get focus. If a requestfocus () is called, the latter is treated preferentially. Note that in the form you want to set a certain one, such as EditText get focus, the light setting this is not possible, you need to set this edittext front of the focusable to false only line. To get focus in touch mode, set Focusableintouchmode to True.


) Android:focusableintouchmode
sets whether view can get focus in touch mode.


One ) android:hapticfeedbackenabled
set the tactile feedback. (Translator Note: Press the soft key and some UI interaction when the vibration, temporarily do not know how to use, you can find Performhapticfeedback or hapticfeedback this keyword information to see. )


android:id)
sets a unique number in the current layout.xml to the current view, which can be found by calling View.findviewbyid () or Activity.findviewbyid () to the corresponding view. There is no conflict between different layout.xml that define the same ID. Format such as "@+id/btnname"


Android:isscrollcontainer)
sets the current view as a scrolling container. There is no test effect here, Listview/gridview/scrollview does not have to set this property, and Edidtext settings android:scrollbars can also scroll bar.


Android:keepscreenon)
whether the view remains awake in the visible case. This property is often used in linearlayout, but the emulator has no effect here.


android:longclickable)
sets whether to respond to long press events.


android:minheight)
set the view minimum height


android:minwidth)
minimum width of the set view


) Android:nextfocusdown
set the specified view below to get the next focus. Focus movement is based on an algorithm that looks for the nearest neighbor in a given direction. If the specified view does not exist, the run-time error is reported when the focus is moved. You can set imeoptions= Actiondone so that you skip to the next focus when you finish typing.


android:nextfocusleft)
sets the left specified view to get the next focus.


Android:nextfocusright
20) Set the specified view on the right to get the next focus.


) Android:nextfocusup
sets the specified view above to get the next focus.


Android:onclick)
invokes the specified method from the context when clicked. Here you specify a method name, typically in activity that defines a function that conforms to the following parameters and return values and assigns the method name string to that value:
Public void OnClickButton (view view)
android:onclick= "OnClickButton"


android:padding)
sets the margin around the top and bottom, padding the blanks in pixels.
 
Android:paddingbottom
sets the bottom margin, in pixels, to fill in the blanks.
              
) Android:paddingleft
sets the left margin, in pixels, to fill in the blanks.
             
android:paddingright)
sets the right margin, in pixels, to fill in the blanks.
             
android:paddingtop)
sets the top margin, in pixels, to fill in the blanks.


android:saveenabled)
set whether to save the view's data when the window freezes (such as rotating the screen), by default, but only if you need to set the ID to save automatically, see here.


android:scrollx)
sets the offset value of the horizontal scrolling in pixels, which is the effect that can be seen in the GridView.


) android:scrolly
sets the offset value for vertical scrolling in pixels


Android:scrollbardefaultdelaybeforefade)
sets the n milliseconds after which to begin the fade, in milliseconds.


android:scrollbarfadeduration)
sets the time, in milliseconds, that the scrollbar fade out effect (from having to slowly fade to vanishing). Android2.2 the scroll bar will disappear after scrolling, and then scroll out, in the 1.5, 1.6 version will always show.


android:scrollbarsize)
sets the width of the scroll bar.


) Android:scrollbarstyle
sets the style and position of the scroll bar. Set values: Insideoverlay, Insideinset, Outsideoverlay, Outsideinset.


android:scrollbarthumbhorizontal)
sets the drawable of the horizontal scroll bar.
                 
android:scrollbarthumbvertical)
sets the drawable of the vertical scroll bar.
                 
android:scrollbartrackhorizontal)
sets the color drawable of the horizontal scroll bar background (track)


Notoginseng) Android:scrollbars
Sets the scroll bar display. None (hidden), horizontal (horizontal), vertical (vertical). See the following code to demonstrate using this property to have a scrollbar inside the edittext. However, other containers such as linearlayout are set but have no effect.


android:soundeffectsenabled)
set Whether you have sound effects when tapping or touching


( Android:tag)
sets a text label. You can use the View.gettag () or for-with
View.findviewwithtag () retrieves the View that contains the tag string. But
It is generally better to query the view by ID, because it is faster and allows
compile-time type checking.

android:visibility)
sets whether the view is displayed. Set Value: Visible (default, display), invisible (not shown, but still occupying space), gone
(do not display, do not occupy space)


android:scrollbartrackvertical)
sets the vertical scrollbar background (trajectory) of the drawable note directly
setting a color value such as "android:color/white" will result in a hard-to-see effect,
I don't even understand this property, so here you can
See Apidemos res/drawable/.
Scrollbar_vertical_thumb.xml and
Scrollbar_vertical_track.xml, set the code to:
android:scrollbartrackvertical = "@drawable/scrollbar_vertical_track"

Android View Properties detailed

Related Article

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.