Best code examples for Android ScrollView class (android.widget.ScrollView)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android ScrollView class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android ScrollView examples from Open Source projects
Examples using Android ScrollView addView method:
This code example shows how to use the following methods: addView, setOrientation, addView
47:	LinearLayout layout = new LinearLayout(this); 
48:	layout.setOrientation(LinearLayout.VERTICAL); 
-
54:	layout.addView(editText); 
-
56:	((ScrollView) mRootView).addView(layout); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: addView, setOrientation, addView
48:	LinearLayout layout = new LinearLayout(this); 
49:	layout.setOrientation(LinearLayout.VERTICAL); 
-
58:	layout.addView(button); 
59:	layout.addView(editText); 
-
61:	((ScrollView) mRootView).addView(layout); 
Full Snippet Info
9
CodeRank
This code example shows how to use the following methods: addView, setFillViewport, setBackgroundColor, setLayoutParams, setScrollContainer
100:	scrollView.setFillViewport(true); 
101:	scrollView.setBackgroundColor(Color.parseColor("#00000000")); 
102:	scrollView.setScrollContainer(false); 
103:	scrollView.setLayoutParams(scrollViewParams); 
104:	scrollView.addView(original); 
-
146:	return new ScrollView(parent); 
Full Snippet Info
7
CodeRank
Examples using Android ScrollView setFillViewport method:
This code example shows how to use the following methods: addView, setFillViewport, setLayoutParams
59:	ScrollView scrollView = new ScrollView(getContext()); 
60:	scrollView.setFillViewport(true); 
61:	scrollView.setLayoutParams(scrollViewLayout); 
62:	scrollView.addView(actionLayoutView, childViewLayout); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: addView, setFillViewport
16:	ScrollView scroll = new ScrollView(this); 
17:	scroll.setFillViewport(true); 
-
22:	scroll.addView(zv); 
-
24:	setContentView(scroll); 
Full Snippet Info
6
CodeRank
Examples using Android ScrollView fullScroll method:
This code example shows how to use the following methods: fullScroll
51:	scroll.fullScroll(View.FOCUS_DOWN); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: removeAllViews, addView, fullScroll
78:	scrollView.removeAllViews(); 
79:	scrollView.addView(layout); 
80:	scrollView.fullScroll(ScrollView.FOCUS_UP); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: fullScroll
186:	sv.fullScroll(ScrollView.FOCUS_DOWN); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: offsetDescendantRectToMyCoords, getMaxScrollAmount, getHeight, getScrollY, isFocused
56:	mScrollView.offsetDescendantRectToMyCoords(descendant, mTempRect); 
-
122:	- mScrollView.getHeight(); 
-
125:	mScrollView.getScrollY()); 
-
131:	maxScroll - mScrollView.getMaxScrollAmount(), 
132:	mScrollView.getScrollY()); 
-
135:	getTopWithinScrollView(mBottomButton) > mScrollView.getScrollY() + mScrollView.getHeight()); 
-
140:	assertTrue("scroll view should be focused", mScrollView.isFocused()); 
Full Snippet Info
6
CodeRank
Examples for other Android ScrollView methods:
Related Android ScrollView Questions & Answers:
ScrollView Class Overview
Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. A ScrollView is a FrameLayout, meaning you should place one child in it containing the entire contents to scroll; this child may itself be a layout manager with a complex hierarchy of objects. A child that is often used is a LinearLayout in a vertical orientation, presenting a vertical array of top-level items that the user can scroll through. You should never use a ScrollView with a ListView, because ListView takes care of its own vertical scrolling. Most importantly, doing this defeats all of the important optimizations in ListView for dealing with large lists, since it effectively forces the ListView to display its entire list of items to fill up the infinite container supplied by ScrollView. The TextView class also takes care of its own scrolling, so does not require a ScrollView, but using the two together is possible to achieve the effect of a text view within a larger container.

ScrollView only supports vertical scr...
Methods
  • fullScroll
    Handles scrolling in response to a "home/end" shortcut press.
  • scrollTo
    Set the scrolled position of your view. This version also clamps the scrolling to the bounds of our child.
  • setFillViewport
    Indicates this ScrollView whether it should stretch its content height to fill the viewport or not.
  • smoothScrollTo
    Like scrollTo(int, int), but scroll smoothly instead of immediately.