B4X Store

ELEVATEUI · B4A · XUI

UIScrollView

Edge-to-edge scroll with no visible scrollbar by default; AddView and RefreshContentSize measure the required range.

78 modules 1,780 APIs

Navigation & onboarding

What it solves

Edge-to-edge scroll with no visible scrollbar by default; AddView and RefreshContentSize measure the required range.

Animated conceptual demonstration, not an exact Android control screenshot.

18 methods4 Designer0 events

When to use this module

Put a dynamic form inside a scrollable region and recalculate its contents when fields are added.

Before integrating, examine its methods, events and Designer options.

B4A integration examples

Tutorials are based on existing project examples or audited APIs. Check each example’s prerequisites; B4A compilation is not claimed.

Scrollbar-free gallery
Existing documentation example control-guides.json Not B4A-compiled

Review required libraries, Designer views and input data before compiling in B4A.

Sub Globals
    Private sv As UIScrollView
    Private xui As XUI
End Sub

Sub Activity_Create(FirstTime As Boolean)
    sv.Initialize
    sv.AddToParent(Activity, 0, 0, 100%x, 100%y)
    sv.Color = xui.Color_White
    sv.ExtraBottomSpace = 20dip
    For i = 0 To 14
        Dim lbl As Label
        lbl.Initialize("")
        lbl.Text = "Section " & (i + 1)
        lbl.TextSize = 18
        lbl.TextColor = 0xFF0F172A
        sv.AddView(lbl, 16dip, i * 72dip, 100%x - 32dip, 60dip)
    Next
    sv.ScrollToTop
End Sub
Edge-to-edge layout with IME
Existing documentation example control-guides.json Not B4A-compiled

Review required libraries, Designer views and input data before compiling in B4A.

Sub Globals
    Private ime As IME
    Private Root As B4XView
    Private ScrollArea As UIScrollView
    Private xui As XUI
End Sub

Sub Activity_Create(FirstTime As Boolean)
    ime.Initialize("ime")
    Root = xui.CreatePanel("")
    Dim safeArea As Rect = ime.GetContentRect
    Activity.AddView(Root, safeArea.Left, safeArea.Top, safeArea.Width, safeArea.Height)
    ScrollArea.Initialize
    ScrollArea.AddToParent(Root, 0, 0, Root.Width, Root.Height)
    ' Añade vistas a ScrollArea.Panel o mediante ScrollArea.AddView
    ScrollArea.RefreshContentSize
End Sub

' Si modificas directamente una vista hija, llama otra vez a:
' ScrollArea.RefreshContentSize

Public methods reference

18 audited signatures

Public Sub Initialize

Prepare the instance before its other methods.

Original catalog note: Inicializa el UIScrollView (sin parámetros, igual que ScrollView nativo)

Public Sub DesignerCreateView(Base As Object, Lbl As Label, Props As Map)

Invoked automatically by the B4A Visual Designer; do not call manually.

Original catalog note: Llamado por el Diseñador de B4A cuando se usa como Custom View

Base As ObjectLbl As LabelProps As Map
Public Sub AddToParent(Parent As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)

Add this view to a parent container using the supplied bounds and options.

Original catalog note: Agrega el UIScrollView a un panel padre desde código Equivalente a crear un ScrollView y hacer AddView(sv, ...)

Parent As B4XViewLeft As IntTop As IntWidth As IntHeight As Int
Public Sub RemoveAllViews

Use RemoveAllViews for its named operation; follow its exact signature.

Original catalog note: Elimina todas las vistas hijas del panel y reinicia la posición de scroll. Equivalente a Panel.RemoveAllViews + ScrollTo(0)

Public Sub RefreshContentSize

Recalculate scrollable content after child layout changes.

Original catalog note: Calcula el tamaño necesario a partir de todas las vistas agregadas al Panel. Úsalo después de agregar, ocultar o redimensionar contenido directamente en Panel. Evita tener que calcular manualmente Panel.Height.

Public Sub setExtraBottomSpace(Value As Int)

Update extra bottom space at runtime when this setting changes.

Original catalog note: Margen adicional al final del contenido. Predeterminado: 10dip. Ejemplo: ScrollContainer.ExtraBottomSpace = 24dip

Value As Int
Public Sub getExtraBottomSpace As Int

Read the current extra bottom space value for validation or UI synchronization.

Returns: Int

Public Sub AddView(View As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)

Use AddView for its named operation; follow its exact signature.

Original catalog note: Agrega una vista y ajusta inmediatamente el contenido. Esta es la alternativa recomendada a Panel.AddView cuando se construye la vista por código.

View As B4XViewLeft As IntTop As IntWidth As IntHeight As Int
Public Sub ScrollTo(Position As Int)

Use ScrollTo for its named operation; follow its exact signature.

Original catalog note: Desplaza a una posición específica en píxeles. Vertical: Y position. Horizontal: X position. Equivalente a sv.ScrollTo(position) del nativo.

Position As Int
Public Sub ScrollToTop

Use ScrollToTop for its named operation; follow its exact signature.

Original catalog note: Desplaza al inicio (arriba o izquierda)

Public Sub ScrollToBottom

Use ScrollToBottom for its named operation; follow its exact signature.

Original catalog note: Desplaza al final del contenido (abajo o derecha)

Public Sub setColor(Color As Int)

Update color at runtime when this setting changes.

Original catalog note: Color de fondo del contenedor (mBase)

Color As Int
Public Sub getColor As Int

Read the current color value for validation or UI synchronization.

Returns: Int

Public Sub getWidth As Int

Read the current width value for validation or UI synchronization.

Original catalog note: Ancho del panel visible (de mBase, no del contenido interno)

Returns: Int

Public Sub getHeight As Int

Read the current height value for validation or UI synchronization.

Original catalog note: Alto del panel visible (de mBase)

Returns: Int

Public Sub getInnerHeight As Int

Read the current inner height value for validation or UI synchronization.

Original catalog note: Alto total del contenido interno (el Panel scrollable) Equivalente a sv.Panel.Height del nativo

Returns: Int

Public Sub getInnerWidth As Int

Read the current inner width value for validation or UI synchronization.

Original catalog note: Ancho total del contenido interno

Returns: Int

Public Sub getSV As CustomListView

Read the current sv value for validation or UI synchronization.

Original catalog note: Devuelve el CustomListView interno (uso avanzado)

Returns: CustomListView

Designer · 4

#DesignerProperty: Key: Color, DisplayName: Color, FieldType: Color, DefaultValue: 0x00000000, Description: Color de fondo del contenedor (transparente por default)#DesignerProperty: Key: Padding, DisplayName: Padding (dip), FieldType: Int, DefaultValue: 0, Description: Relleno interno alrededor del contenido (dip)#DesignerProperty: Key: ShowScrollBar, DisplayName: Mostrar barra de scroll, FieldType: Boolean, DefaultValue: False, Description: Mostrar indicador de barra de scroll#DesignerProperty: Key: Orientation, DisplayName: Orientación, FieldType: String, DefaultValue: Vertical, List: Vertical|Horizontal, Description: Dirección del scroll

Public events and how to implement them · 0

No public callback events are declared in the catalog. You can still handle B4A events for controls inserted inside it.

Public fields, constants and types

Public mBase As B4XViewPublic Panel As B4XView
Source: ElevateUI public API catalog; tutorials cross-checked against ElevateUI(6).b4xlib. Visualizations are illustrative; sample code requires B4A compilation.