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 |
Tags
- 코틀린
- 안드로이드
- JS
- Kotlin
- 오버라이딩
- scrollview
- npm
- stylesheet
- fragment
- SpringBoot
- 랜덤넘버
- Java
- TextView
- JavaScript
- Android
- 구글맵스
- Linux
- 자바스크립트
- 스프링부트
- nodejs
- RecyclerView
- 랜덤번호
- button
- array
- Javscript
- GoogleMaps
- TypeScript
- React
- Hook
- 리액트
Archives
- Today
- Total
타닥타닥 개발자의 일상
ScrollView / TableLayout 이용하여 스크롤 가능한 안드로이드 화면 만들기 본문
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
<TableRow>
<TextView android:text="국어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="영어" android:textSize="50dp" android:paddingBottom="100dp"/>
<TextView android:text="수학" android:textSize="50dp" android:paddingBottom="100dp"/>
</TableRow>
</TableLayout>
</ScrollView
>
scrollview 안에서 테이블 구현하고 테이블이 쌓이면 스크롤이 되게 코딩.
위의 화면처럼 스크롤이 내려가는 화면이 구현된다.
'코딩 기록 > Kotlin' 카테고리의 다른 글
Kotlin 안드로이드 화면에 videoView이용해 동영상 삽입하기 (0) | 2022.02.07 |
---|---|
Kotlin 정렬된 grid 안드로이드 화면에 표시하기, grid에서 선택한 사항 textview랑 연결하기 (0) | 2022.02.07 |
Kotlin / listview 이용해서 android화면에 스크롤 사용하는 긴 선택항목 만들기 (0) | 2022.02.07 |
kotlin 원하는 이미지파일 android 화면에서 배경으로 설정하는 방법 android:background (0) | 2022.02.07 |
Kotlin 안드로이드 화면에 Spinner 보이게 하기, Spinner로 선택한 항목 textView랑 연결하기 (0) | 2022.02.07 |
Comments