반응형
Linear layout ? 수평나열 default : horizontal
SRC : recousce 거 쓰는거임.
1. new project create contraint layout 지우고 Linear layuot 설정 |
|
2. layout -> background color 변경 | <layout....... |
3. ImageView. TextView -> image 추가 / text 추가(@string으로 설정 다음강의서 할거임.) | <ImageView> / <TextView> |
4. layout- > vertical로 설정 | <layout.............. android orientaton="vertical" |
5 layout->gravity : "center" | <layout....... |
6. text 블럭 크기 설정 : padding |
activity_main.xml (디자인 text버전)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" //V layout 설정
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" //V vertical
android:gravity="center" //V gravity
tools:context=".MainActivity"
tools:ignore="ExtraText"
android:background="@color/colorPrimaryDark"> //V color설정
<ImageView //V 이미지 추가
android:src="@drawable/ic_launcher_foreground"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView //V 텍스트 추가
android:id="@+id/answer_text_view"
android:text="My test Question"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp" /> //V padding 텍스트블럭 크기 조절
</LinearLayout>
'AndroidStudio' 카테고리의 다른 글
9.2 quiz app / MVC / string data들 add / 코딩 (0) | 2020.08.15 |
---|---|
9.1 quiz app / Linear layout 내부에 추가(버튼추가) / 코딩 (0) | 2020.08.15 |
5.4 조건부 글자색 변경 / 코딩 (0) | 2020.08.09 |
2. 클릭하면 name 입력값 나오는 코딩. (0) | 2020.08.01 |
1. showName coding (0) | 2020.08.01 |