250x250
Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 막내의막무가내 코틀린 안드로이드
- Fragment
- 막내의 막무가내 알고리즘
- 막내의막무가내 rxjava
- flutter network call
- 막내의막무가내 알고리즘
- 막내의 막무가내
- 막내의막무가내 안드로이드 코틀린
- 주택가 잠실새내
- 안드로이드 Sunflower 스터디
- 막내의막무가내 코볼 COBOL
- 주엽역 생활맥주
- 막내의막무가내 일상
- 막내의막무가내 안드로이드 에러 해결
- 부스트코스에이스
- 2022년 6월 일상
- 막내의막무가내 프로그래밍
- 프로그래머스 알고리즘
- 막내의막무가내 목표 및 회고
- 안드로이드
- 막내의막무가내 플러터 flutter
- 막내의막무가내 안드로이드
- 프래그먼트
- 막내의막무가내 SQL
- 막무가내
- 막내의막무가내 플러터
- 막내의막무가내 코틀린
- 안드로이드 sunflower
- 막내의막무가내
- 부스트코스
Archives
- Today
- Total
막내의 막무가내 프로그래밍 & 일상
[안드로이드] FrameLayout, ScrollView 사용시 특정 뷰 위치 고정시키기 본문
728x90
* 프로그래머스 화해 과제인데 작성날짜는 비공개로 올린 날짜고 공개로 돌린 건 과제가 종료되고 한달뒤쯤임을 말씀드립니다.
그냥 FrameLayout과 ScrollView를 동시에 사용시 스크롤뷰를 내리면 프레임레이아웃으로 설정해논 버튼이 사라진다.
viewPort등 다양한 방법을 봤지만 난 다음과 같이 해결하였다.
LinearLayout이 가장 상위 레이아웃으로 두고
그 밑에 프레임레이아웃을 두고
프레임레이아웃 자식으로 스크롤뷰와(스크롤이 될 뷰) 고정되야할 뷰를 두었다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
android:paddingTop="8dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingBottom="24dp"
tools:context=".activities.PurchaseActivity">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:id="@+id/purchase_iv_image"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:padding="8dp"
tools:src="@tools:sample/avatars" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorLightGray"/>
<TextView
android:id="@+id/purchase_tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textSize="36sp"
android:text="국제약 센틸리안24 파워 부스팅 포뮬러 마데카 크림 50ml "
android:textStyle="bold" />
<TextView
android:id="@+id/purchase_tv_price"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textSize="28sp"
android:textColor="@color/colorPurple"
android:text="10,800원" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorLightGray"/>
<TextView
android:id="@+id/purchase_tv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp"
android:textSize="20sp"
android:text="@string/ex_sentence"/>
<TextView
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="15sp"
android:background="@drawable/bg_round_gray"
android:textColor="@color/colorGray"
android:layout_marginBottom="60dp"
android:text="@string/notice"
/>
</LinearLayout>
</ScrollView>
<de.hdodenhof.circleimageview.CircleImageView
android:id="@+id/purchase_civ_close"
android:layout_width="40dp"
android:src="@drawable/ic_close"
android:layout_gravity="end|top"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:layout_height="40dp" />
<Button
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:id="@+id/purchase_btn_purchase"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_gravity="bottom|center_horizontal"
android:text="구매하기"
android:background="@drawable/bg_round_purple"
android:textColor="@color/colorWhite"
android:layout_marginBottom="16dp"
android:layout_height="wrap_content"/>
</FrameLayout>
</LinearLayout>
728x90
'안드로이드' 카테고리의 다른 글
[안드로이드][스마트폰] 개발자 옵션 사라진 경우 해결방법 (0) | 2020.03.09 |
---|---|
[안드로이드] 앱 출시 후 해시 키(인증) 에러 (feat. 카카오 api, 파이어베이스 구글로그인) (0) | 2020.02.08 |
[안드로이드] java.lang.BootstrapMethodError: Exception from call site #4 bootstrap method 에러 (2) | 2020.01.02 |
[안드로이드] 레트로핏2 이미지업로드 Multipart Retrofit2 글 (0) | 2019.09.03 |
[안드로이드] 자바객체 -> JSON , JSON -> 자바객체 변환 설명한 사이트 (0) | 2019.08.05 |
Comments