Open wjdwnsgnl opened 5 years ago
안녕하세요
전체화면에 되게맞추면 안 됩니다 그 이유는 아래 링크 내용을 확인해보세요 https://github.com/ssomai/ScalableLayout/blob/master/README_ko.md#scalablelayout%EC%9C%BC%EB%A1%9C-layout%ED%95%98%EC%8B%A4-%EB%95%8C-%EC%B0%B8%EA%B3%A0%ED%95%98%EC%85%94%EC%95%BC-%ED%95%A0-%EC%A0%90
값이 다양한데 그것은 비율이기 때문입니다 비율이기에 값 자체가 얼마냐가 중요한 것은 아닙니다 그리고 scalablelayout은 전체화면을 레이아웃하는용도가 아닙니다 화면의 부분 부분을 레이아웃하는 용도이기 때문에 width, height는 디자인에 맞춰서 설정됩니다
여기 git에 샘플 앱이 있으니 그 앱에서 다양하게 값을 변경해보면서 직접 레이아웃해보시면 감이 오실겁니다
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.jjunsoft1.smartdoll.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/back01"
android:orientation="vertical">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="51dp"
android:textSize="20sp"
android:layout_centerVertical="true"
android:text="리틀프랜즈캠프"
android:textStyle="bold"
android:textColor="#212121"
android:paddingTop="10dp"
android:background="#ffffff"
android:paddingLeft="20dp"/>
</RelativeLayout>
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="46dp"
android:text="아래에 블루투스 버튼을 눌러 디바이스를 검색하세요."
android:background="#d85aa2"
android:textColor="#ffffff"
android:textSize="12sp"
android:paddingTop="14dp"
android:paddingLeft="60dp"
android:visibility="visible"/>
<ImageView
android:layout_width="166dp"
android:layout_height="46dp"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:src="@drawable/top" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/back"
android:layout_width="300dp"
android:layout_height="360dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:src="@drawable/n_02" />
<ImageView
android:id="@+id/bluetoothOn"
android:layout_width="108dp"
android:layout_height="106dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="171dp"
android:src="@drawable/p_bt"
android:visibility="invisible"/>
<ImageView
android:id="@+id/record"
android:layout_width="157dp"
android:layout_height="79dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="77dp"
android:src="@drawable/b_01"
android:visibility="invisible" />
<ImageView
android:id="@+id/play"
android:layout_width="114dp"
android:layout_height="138dp"
android:layout_marginLeft="215dp"
android:layout_marginTop="96dp"
android:src="@drawable/b_02"
android:visibility="invisible"/>
<ImageView
android:id="@+id/follow"
android:layout_width="114dp"
android:layout_height="138dp"
android:layout_marginLeft="29dp"
android:layout_marginTop="98dp"
android:src="@drawable/b_03"
android:visibility="invisible" />
<ImageView
android:id="@+id/rabbit"
android:layout_width="105dp"
android:layout_height="141dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="30dp"
android:layout_marginBottom="107dp"
android:visibility="visible"
android:src="@drawable/b_04" />
<ImageView
android:id="@+id/funny"
android:layout_width="105dp"
android:layout_height="141dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="224dp"
android:layout_marginBottom="107dp"
android:visibility="invisible"
android:src="@drawable/b_05" />
<ImageView
android:id="@+id/cute"
android:layout_width="157dp"
android:layout_height="62dp"
android:layout_marginTop="312dp"
android:layout_centerHorizontal="true"
android:visibility="invisible"
android:src="@drawable/b_06" />
<SeekBar
android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="27dp"
android:layout_alignParentTop="true"
android:layout_marginTop="380dp"
android:max="100"
android:progress="20"
android:progressDrawable="@drawable/seekbar_seekbar"
android:thumb="@drawable/rabbit_bt"
android:maxHeight="5dp"
android:minHeight="5dp"/>
<ImageView
android:layout_width="271dp"
android:layout_height="14dp"
android:src="@drawable/pm"
android:layout_marginTop="510dp"
android:layout_centerHorizontal="true"/>
<ImageView
android:layout_width="72dp"
android:layout_height="17dp"
android:src="@drawable/m_text"
android:layout_centerHorizontal="true"
android:layout_marginTop="515dp"/>
<ImageView
android:layout_width="164dp"
android:layout_height="12dp"
android:src="@drawable/footer"
android:layout_marginTop="540dp"
android:layout_centerHorizontal="true"
/>
</RelativeLayout>
</LinearLayout>
제가 이런식으로 지금 짜저있는상태에서 그럼 엔에 들어가는 이미지들만 ScalableLayout으로 감싸라는 말씀이신거줘????
네 그렇게 하면 될듯합니다~
궁금한게있어서그러느데요 ScalableLayout이 무조건 텍스트뷰에 맞춰서움직이는건가요?? 아님 텍스트뷰가 없어도 되는건가요??
구체적으로 코드를 보여주실수있나요? 텍스트 뷰에 대한 설명도 readme에 있으니 참고 하시면 될듯합니다
죄성한데요.ㅠ app:scale_base_width="" app:scale_base_height="" 에대해서 설명 조금만 해주시면안될까요??
ScalableLayout의 비율 기반 크기입니다 직접 샘플을 가지고 숫자를 변경해보면서 확인해보시면 쉽게 어떤것인지 이해하실수있습니다
네 감사합니다 지금 숫자바꿔가면서 해보는중이에요 하다가 이해가안되는부분있음 글쓰겠습니다 ^^
앗 엄청 늦게 확인했네요... ㅎㅎ 언제든 질문 올려주세요 감사합니다 ^^
현재 사용을시도하려고하는데 width와 height의 값이 어떻게 들어가는건지 이해가잘안갑니다 그냥 전체화면에 되게 맞춰서 값을 넣어주면 되는건가요?? 400,300 넣으신분도있으시고 1400 1200 넣으신분도있으시고 width 값이 더크게 들어가있던데 그부분은 외그런가요 height가 더긴데 왜 width가 저큰값이 들어간건가요?? 잘이해가 안가 이렇게 글을썻습니다.ㅠ ㅠ죄송합니다.