"Android" Scrollview related issues summary

Source: Internet
Author: User

Remove ScrollView sliding boundary gradient color

The scroll bar is removed and the boundary does not turn gray when sliding

< Horizontalscrollview      Android:overscrollmode = "Never"     android:background= "@null"    android:scrollbars= "None"     Android:fadingedge= "None"/>

ScrollView Initialize the position of the anchor scroll bar
Call Mhandler.post (Mscrollview) where needed;

Private New Runnable () {      @Override      publicvoid  run () {            Scrollview.scrollto (10 , 30); // change the position  of the scroll bar     }    };  

Scroll Bar Properties Detailed

Tag:android scroll bar disappears

Property name

Describe

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 If you want to be transparent, you have to write this attribute.

Android:clickable

Whether to respond to click events.

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.

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, use higher color depth, consumes more memory)/low (Low quality, use a lower color depth, but with less memory).

Android:duplicateparentstate

If this property is set, the drawing state is obtained directly from the parent container (cursor, press inferior). See the Code section below, note that according to the current test situation is just to get the drawing state, and not get the event, that is, you click on the linearlayout Button has clicked effect, but do not perform the Click event.

Android:fadingedge

Sets the direction in which the border gradient is placed when the scrollbar is drawn. None (The border color does not change), Horizontal (The horizontal direction color is dimmed), Vertical (the color in the vertical direction is dimmed). Refer to the fadingedgelength

Android:fadingedgelength

Sets the length of the border gradient.

Android:fitssystemwindows

Whether to consider system windows (such as status bar) when setting layout adjustments

Android:focusable

Sets whether to get focus. If a requestfocus () is called, the latter is treated preferentially. Note In the form that you want to set a certain one, such as EditText get focus, light setting this is not possible, need to put this EditText front Focusable are set to false . to get focus in Touch mode, set focusableintouchmode to true.

Android:focusableintouchmode

Sets whether View can get focus in Touch mode .

Android:hapticfeedbackenabled

Sets whether to accept other touch feedback events on a regular basis. Here the simulator has no effect, is it a multi-touch? Can not find information to find performhapticfeedback or hapticfeedback This keyword information to see.

Android:id

sets a unique number in the current layout.xml for the current View , either by calling View.findviewbyid () or Activity.findviewbyid () finds the corresponding View according to this number . 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 at all, and edidtext settings the android:scrollbars can also be scrolled.

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

Set the minimum width of a view

Android:nextfocusdown

Set below Specifies that the view gets 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= actiondoneso that you skip to the next focus when you finish typing.

Android:nextfocusleft

Set left Specifies that the view gets the next focus.

Android:nextfocusright

Set Right Specifies that the view gets the next focus.

Android:nextfocusup

Set above Specifies that the view gets 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

Sets 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:scrollbaralwaysdrawhorizontaltrack

Sets whether the horizontal scroll bar is always displayed. Here with ScrollView,theListView test has no effect.

Android:scrollbaralwaysdrawverticaltrack

Sets whether the vertical scroll bar is always displayed. Here with ScrollView,theListView test has no effect.

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 the scroll will come out, 1.5 , 1.6 The version will always be displayed.

Android:scrollbarsize

Sets the width of the scroll bar.

Android:scrollbarstyle

Sets the style and position of the scroll bar. Setting values:insideoverlay,insideinset,outsideoverlay, Outsideinset. There are not too many effects, the following is outsideoverlay and outsideinset effect comparison:

Android:scrollbarthumbhorizontal

Sets the drawable(such as color) of the horizontal scroll bar.

Android:scrollbarthumbvertical

Sets the drawable(such as color)of the vertical scroll bar.

Android:scrollbartrackhorizontal

Sets the color drawable(such as color) of the horizontal scroll bar background (track)

android:scrollbartrackvertical

set vertical scroll bar background (trajectory) drawable Note Setting the color values directly such as " android:color/white " will result in a very difficult effect, even if you do not understand this property, Here you can see apidemos res/drawable/ scrollbar_vertical_thumb.xml and Scrollbar_vertical_track.xml , the setting code is: android:scrollbartrackvertical = "@drawable/scrollbar_vertical_track"

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. The View that contains the tag string can be retrieved by View.gettag () or for with View.findviewwithtag () . However , it is generally better to query the Viewby ID because it is faster and allows compile-time type checking.

Android:visibility

Sets whether the viewis displayed. Set Value:visible(default value

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.