Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- CLASS
- docker-compose
- LiveData
- Filter
- class component
- Foreign Key
- elementAt
- recyclerview
- 생명주기
- Interface
- lifecycle
- vuex
- docker
- Kotlin
- function
- Service
- collection
- enum
- AWS
- MINUS
- list
- Swift
- ReactNative
- react native
- animation
- ConstraintLayout
- mongoose
- union
- map
- Generic
Archives
- Today
- Total
개발 일기
Using a ScrollView 본문
ScrollView
ScrollView는 안에 다양한 컴포넌트를 포함시켜도 스크롤이 가능하게끔 설계가 되어있습니다.
또한 가로 세로도 모두 포함을 합니다.
아래 예시에서는 vertical(세로) ScrollView에 대해서 예제를 보여드리도록 하겠습니다.
import React from 'react';
import { Image, ScrollView, Text } from 'react-native';
const logo = {
uri: 'https://reactnative.dev/img/tiny_logo.png',
width: 64,
height: 64
};
export default App = () => (
<ScrollView>
<Text style={{ fontSize: 96 }}>Scroll me plz</Text>
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Text style={{ fontSize: 96 }}>If you like</Text>
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Text style={{ fontSize: 96 }}>Scrolling down</Text>
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Text style={{ fontSize: 96 }}>What's the best</Text>
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Text style={{ fontSize: 96 }}>Framework around?</Text>
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Image source={logo} />
<Text style={{ fontSize: 80 }}>React Native</Text>
</ScrollView>
);
ScrollView Component에서는 paging 처리를 설정할수가 있습니다. 마치 안드로이드에서는 ViewPager 처럼 "pagingEnabled"을 통해서 설정할수가 있습니다.
또한 maximumZoomScale , minimumZoomScale 을 통해서 zoom 설정을 할수가 있습니다.
'Client > React Native' 카테고리의 다른 글
Style (0) | 2020.05.26 |
---|---|
Using List Views (0) | 2020.05.25 |
Handling Text Input ? (0) | 2020.05.22 |
React Fundamentals ? (0) | 2020.05.17 |
Core Component and Native Components ? (0) | 2020.05.16 |
Comments