ScrollView滚动视图Word文档下载推荐.docx
《ScrollView滚动视图Word文档下载推荐.docx》由会员分享,可在线阅读,更多相关《ScrollView滚动视图Word文档下载推荐.docx(21页珍藏版)》请在冰豆网上搜索。
fillViewportsetFillViewport(boolean)Defineswhetherthescrollviewshouldstretchitscontenttofilltheviewport.
[Expand]
InheritedXMLAttributes
Fromclassandroid.widget.FrameLayout
Fromclassandroid.view.ViewGroup
Fromclassandroid.view.View
InheritedConstants
InheritedFields
PublicConstructors
ScrollView(Contextcontext)
ScrollView(Contextcontext,AttributeSetattrs)
ScrollView(Contextcontext,AttributeSetattrs,intdefStyleAttr)
ScrollView(Contextcontext,AttributeSetattrs,intdefStyleAttr,intdefStyleRes)
PublicMethods
voidaddView(Viewchild,intindex)
Addsachildview.
voidaddView(Viewchild,intindex,ViewGroup.LayoutParamsparams)
Addsachildviewwiththespecifiedlayoutparameters.
voidaddView(Viewchild)
voidaddView(Viewchild,ViewGroup.LayoutParamsparams)
booleanarrowScroll(intdirection)
Handlescrollinginresponsetoanupordownarrowclick.
voidcomputeScroll()
CalledbyaparenttorequestthatachildupdateitsvaluesformScrollXandmScrollYifnecessary.
booleandispatchKeyEvent(KeyEventevent)
Dispatchakeyeventtothenextviewonthefocuspath.
voiddraw(Canvascanvas)
Manuallyrenderthisview(andallofitschildren)tothegivenCanvas.
booleanexecuteKeyEvent(KeyEventevent)
Youcancallthisfunctionyourselftohavethescrollviewperformscrollingfromakeyevent,justasiftheeventhadbeendispatchedtoitbytheviewhierarchy.
voidfling(intvelocityY)
Flingthescrollview
booleanfullScroll(intdirection)
Handlesscrollinginresponsetoa"
home/end"
shortcutpress.
CharSequencegetAccessibilityClassName()
Returntheclassnameofthisobjecttobeusedforaccessibilitypurposes.
intgetMaxScrollAmount()
booleanisFillViewport()
IndicateswhetherthisScrollView'
scontentisstretchedtofilltheviewport.
booleanisSmoothScrollingEnabled()
booleanonGenericMotionEvent(MotionEventevent)
Implementthismethodtohandlegenericmotionevents.
booleanonInterceptTouchEvent(MotionEventev)
Implementthismethodtointerceptalltouchscreenmotionevents.
booleanonNestedFling(Viewtarget,floatvelocityX,floatvelocityY,booleanconsumed)
Requestaflingfromanestedscroll.
voidonNestedScroll(Viewtarget,intdxConsumed,intdyConsumed,intdxUnconsumed,intdyUnconsumed)
Reacttoanestedscrollinprogress.
voidonNestedScrollAccepted(Viewchild,Viewtarget,intaxes)
Reacttothesuccessfulclaimingofanestedscrolloperation.
booleanonStartNestedScroll(Viewchild,Viewtarget,intnestedScrollAxes)
Reacttoadescendantviewinitiatinganestablescrolloperation,claimingthenestedscrolloperationifappropriate.
voidonStopNestedScroll(Viewtarget)
Reacttoanestedscrolloperationending.
booleanonTouchEvent(MotionEventev)
Implementthismethodtohandletouchscreenmotionevents.
booleanpageScroll(intdirection)
pageup/down"
voidrequestChildFocus(Viewchild,Viewfocused)
Calledwhenachildofthisparentwantsfocus
booleanrequestChildRectangleOnScreen(Viewchild,Rectrectangle,booleanimmediate)
Calledwhenachildofthisgroupwantsaparticularrectangletobepositionedontothescreen.
voidrequestDisallowInterceptTouchEvent(booleandisallowIntercept)
CalledwhenachilddoesnotwantthisparentanditsancestorstointercepttoucheventswithonInterceptTouchEvent(MotionEvent).
voidrequestLayout()
Callthiswhensomethinghaschangedwhichhasinvalidatedthelayoutofthisview.
voidscrollTo(intx,inty)
Setthescrolledpositionofyourview.
Thisversionalsoclampsthescrollingtotheboundsofourchild.
voidsetFillViewport(booleanfillViewport)
IndicatesthisScrollViewwhetheritshouldstretchitscontentheighttofilltheviewportornot.
voidsetOverScrollMode(intmode)
Settheover-scrollmodeforthisview.
voidsetSmoothScrollingEnabled(booleansmoothScrollingEnabled)
Setwhetherarrowscrollingwillanimateitstransition.
booleanshouldDelayChildPressedState()
ReturntrueifthepressedstateshouldbedelayedforchildrenordescendantsofthisViewGroup.
finalvoidsmoothScrollBy(intdx,intdy)
LikescrollBy(int,int),butscrollsmoothlyinsteadofimmediately.
finalvoidsmoothScrollTo(intx,inty)
LikescrollTo(int,int),butscrollsmoothlyinsteadofimmediately.
ProtectedMethods
intcomputeScrollDeltaToGetChildRectOnScreen(Rectrect)
ComputetheamounttoscrollintheYdirectioninordertogetarectanglecompletelyonthescreen(or,iftallerthanthescreen,atleastthefirstscreensizechunkofit).
intcomputeVerticalScrollOffset()
Computetheverticaloffsetoftheverticalscrollbar'
sthumbwithinthehorizontalrange.
intcomputeVerticalScrollRange()
Thescrollrangeofascrollviewistheoverallheightofallofitschildren.
floatgetBottomFadingEdgeStrength()
Returnsthestrength,orintensity,ofthebottomfadededge.
floatgetTopFadingEdgeStrength()
Returnsthestrength,orintensity,ofthetopfadededge.
voidmeasureChild(Viewchild,intparentWidthMeasureSpec,intparentHeightMeasureSpec)
Askoneofthechildrenofthisviewtomeasureitself,takingintoaccountboththeMeasureSpecrequirementsforthisviewanditspadding.
voidmeasureChildWithMargins(Viewchild,intparentWidthMeasureSpec,intwidthUsed,intparentHeightMeasureSpec,intheightUsed)
Askoneofthechildrenofthisviewtomeasureitself,takingintoaccountboththeMeasureSpecrequirementsforthisviewanditspaddingandmargins.
voidonDetachedFromWindow()
Thisiscalledwhentheviewisdetachedfromawindow.
voidonLayout(booleanchanged,intl,intt,intr,intb)
Calledfromlayoutwhenthisviewshouldassignasizeandpositiontoeachofitschildren.
voidonMeasure(intwidthMeasureSpec,intheightMeasureSpec)
Measuretheviewanditscontenttodeterminethemeasuredwidthandthemeasuredheight.
voidonOverScrolled(intscrollX,intscrollY,booleanclampedX,booleanclampedY)
CalledbyoverScrollBy(int,int,int,int,int,int,int,int,boolean)torespondtotheresultsofanover-scrolloperation.
booleanonRequestFocusInDescendants(intdirection,RectpreviouslyFocusedRect)
Whenlookingforfocusinchildrenofascrollview,needtobealittlemorecarefulnottogivefocustosomethingthatisscrolledoffscreen.
voidonRestoreInstanceState(Parcelablestate)
Hookallowingaviewtore-applyarepresentationofitsinternalstatethathadpreviouslybeengeneratedbyonSaveInstanceState().
ParcelableonSaveInstanceState()
Hookallowingaviewtogeneratearepresentationofitsinternalstatethatcanlaterbeusedtocreateanewinstancewiththatsamestate.
voidonSizeChanged(intw,inth,intoldw,intoldh)
Thisiscalledduringlayoutwhenthesizeofthisviewhaschanged.
InheritedMethods
Fromclassandroid.widget.FrameLayout
Fromclassandroid.view.ViewGroup
Fromclassandroid.view.View
Fromclassjava.lang.Object
Frominterfaceandroid.view.ViewParent
Frominterfaceandroid.view.ViewManager
Frominterfaceandroid.graphics.drawable.Drawable.Callback
Frominterfaceandroid.view.KeyEvent.Callback
Frominterfaceandroid.view.accessibility.AccessibilityEventSource
fillViewport
Defineswhetherthescrollviewshouldstretchitscontenttofilltheviewport.
Mustbeabooleanvalue,either"
true"
or"
false"
.
Thismayalsobeareferencetoaresource(intheform"
@[package:
]type:
name"
)orthemeattribute(intheform"
?
[package:
][type:
]name"
)containingavalueofthistype.
ThiscorrespondstotheglobalattributeresourcesymbolfillViewport.
RelatedMethods
setFillViewport(boolean)
publicScrollView(Contextcontext)
AddedinAPIlevel1
publicScrollView(Contextcontext,AttributeSetattrs)
publicScrollView(Contextcontext,AttributeSetattrs,intdefStyleAttr)
publicScrollView(Contextcontext,AttributeSetattrs,intdefStyleAttr,intdefStyleRes)
AddedinAPIlevel21
publicvoidaddView(Viewchild,intindex)
Addsachildview.Ifnolayoutparametersarealreadysetonthechild,thedefaultparametersforthisViewGrouparesetonth