Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Implementing ScrollView for Scrolling Content | Core Concepts of React Native
Foundations of React Native

bookImplementing ScrollView for Scrolling Content

Theory

The ScrollView component creates a scrollable view with a flexible height. It's particularly useful when you have content that exceeds the available space on the screen.

Why Use ScrollView

  • Scrolling Content: Allows you to create a container that can be scrolled vertically or horizontally to view its content;
  • Handling Overflow: Useful when the content inside a view is too large to fit on the screen.

Working with ScrollView

  • Wrap the content we want to make scrollable inside the ScrollView component;
  • The contentContainerStyle prop is used to style the content inside the scroll view;
  • We can change the default vertical scroll behavior to horizontal by providing the prop horizontal.

Example

Result

In Practice

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 8

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Awesome!

Completion rate improved to 3.45

bookImplementing ScrollView for Scrolling Content

Sveip for å vise menyen

Theory

The ScrollView component creates a scrollable view with a flexible height. It's particularly useful when you have content that exceeds the available space on the screen.

Why Use ScrollView

  • Scrolling Content: Allows you to create a container that can be scrolled vertically or horizontally to view its content;
  • Handling Overflow: Useful when the content inside a view is too large to fit on the screen.

Working with ScrollView

  • Wrap the content we want to make scrollable inside the ScrollView component;
  • The contentContainerStyle prop is used to style the content inside the scroll view;
  • We can change the default vertical scroll behavior to horizontal by providing the prop horizontal.

Example

Result

In Practice

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 8
some-alt