본문 바로가기
프로그래밍 놀이터/안드로이드, Java

[android] Percent Support Library

by 돼지왕 왕돼지 2017. 9. 16.
반응형

 [android] Percent Support Library


https://plus.google.com/+AndroidDevelopers/posts/C8oaLunpEEj

Android, attribute, layout_aspectRatio, layout_heightPercent, layout_marginBottomPercent, layout_marginEndPercent, layout_marginLeftPercent, layout_marginRightPercent, layout_marginStartPercent, layout_marginTopPercent, layout_widthPercent, percent support library, percent 기반 layouting, percentframelayout, percentrelativelayout, [android] Percent Support Library


-

PercentFrameLayout, PercentRelativeLayout 이 생겨서 percent 기반한 layouting 을 할 수 있다.



-

<android.support.percent.PercentRelativeLayout>

 <ImageView

  android:id=”@+id/centered_image”

  android:layout_gravity=”center”

  app:layout_widthPercent="50%"

  app:layout_heightPercent="50%" />

 <TextView

  android:id=”@+id/caption”

  android:layout_width="wrap_content"

  android:layout_height="wrap_content"

  android:layout_below=”@id/centered_image”

  android:layout_gravity=”center_horizontal”

  app:layout_marginStartPercent=”25%”

  app:layout_marginEndPercent=”25%” />

</android.support.percent.PercentRelativeLayout>



-

지원하는 attribute 들은..

layout_widthPercent

layout_heightPercent

layout_marginTopPercent

layout_marginBottomPercent

layout_marginLeftPercent

layout_marginRightPercent

layout_marginStartPercent

layout_marginEndPercent

layout_aspectRatio




반응형

댓글