| java.lang.Object | ||
| ↳ | com.neomades.ui.View | |
| ↳ | com.neomades.ui.ScrollView | |
A ScrollView represents a view with scrollbars (vertical and/or
horizontal).
setHorizontalScroll(boolean). You
change the type of Layout, by calling the setContent(Layout)
method.
MATCH_CONTENT for
ListViews or ScrollViews at all times.MATCH_PARENT for height of
the ScrollView's content at all times.MATCH_CONTENT in the hierarchy could break
down the ScrollView display.
| XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Attribute Name | Related Method | Description | |||||||||
| horizontalScroll | setHorizontalScroll(boolean) | If the scrollview could scroll horizontally | |||||||||
| verticalScroll | setVerticalScroll(boolean) | If the scrollview could scroll vertically | |||||||||
|
[Expand]
Inherited XML Attributes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
|
[Expand]
Inherited Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.neomades.ui.Alignment
| |||||||||||
From interface
com.neomades.ui.StretchMode
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
ScrollView()
Creates a new ScrollView.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
scrollTo(int x, int y)
Set the scrolled position of the content view.
| ||||||||||
| void |
setContent(Layout layout)
Set content of the ScrollView.
| ||||||||||
| void |
setHorizontalScroll(boolean scroll)
Enables or disables the horizontal scroll
| ||||||||||
| void |
setScrollbarAlwaysVisible(boolean alwaysVisible)
Enables scroll bars of this ScrollView to be always visible (even if the
ScrollView is not scrolling). | ||||||||||
| void |
setVerticalScroll(boolean scroll)
Enables or disables the vertical scroll
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.neomades.ui.View
| |||||||||||
From class
java.lang.Object
| |||||||||||
If the scrollview could scroll horizontally
Creates a new ScrollView.
Set the scrolled position of the content view.
| x | the x position (in DP units) to scroll to |
|---|---|
| y | the y position (in DP units) to scroll to |
Set content of the ScrollView.
Note that if the layout is a VerticalLayout, vertical scroll will be enabled
by default. If the layout is a HorizontalLayout, horizontal scroll will be
enabled by default. The scroll direction can be changed calling
setHorizontalScroll(boolean) or
setVerticalScroll(boolean).
| layout | ScrollView content |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|---|
| IllegalStateException | if the layout has already a parent |
Enables or disables the horizontal scroll
| scroll | true if the scrollbar could appear |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|
Enables scroll bars of this ScrollView to be always visible (even if the
ScrollView is not scrolling).
| alwaysVisible | true to be always visible, false if visible when the view is scrolling |
|---|
Enables or disables the vertical scroll
| scroll | true if the scrollbar could appear |
|---|
| CrossThreadException | if the method is called from outside the UI-Thread |
|---|