개발 포스팅은 언제나 유통기한에 주의하세요

 


 

https://developer.android.com/guide/topics/resources/drawable-resource?hl=ko#Shape

 

<?xml version="1.0" encoding="utf-8"?>
<shape
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape=["rectangle" | "oval" | "line" | "ring"] >
    <corners
        android:radius="integer"
        android:topLeftRadius="integer"
        android:topRightRadius="integer"
        android:bottomLeftRadius="integer"
        android:bottomRightRadius="integer" />
    <gradient
        android:angle="integer"
        android:centerX="float"
        android:centerY="float"
        android:centerColor="integer"
        android:endColor="color"
        android:gradientRadius="integer"
        android:startColor="color"
        android:type=["linear" | "radial" | "sweep"]
        android:useLevel=["true" | "false"] />
    <padding
        android:left="integer"
        android:top="integer"
        android:right="integer"
        android:bottom="integer" />
    <size
        android:width="integer"
        android:height="integer" />
    <solid
        android:color="color" />
    <stroke
        android:width="integer"
        android:color="color"
        android:dashWidth="integer"
        android:dashGap="integer" />
</shape>

 

shape : 모양, default=rectangle

corners : 모서리의 둥근 정도

gradient : 그라데이션이 들어간 배경

padding : 패딩

size : 사이즈

solid : 배경색

stroke : 외곽선

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <size android:width="100dp"
        android:height="100dp" />

    <solid android:color="@color/colorPrimary" />

    <stroke android:color="@color/colorAccent"
        android:width="10dp"/>

    <corners android:radius="0dp" />

</shape>

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <size android:width="100dp"
        android:height="100dp" />

    <solid android:color="@color/colorPrimary" />

    <stroke android:color="@color/colorAccent"
        android:width="10dp"/>

    <corners android:radius="10dp" />

</shape>

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <size android:width="100dp"
        android:height="100dp" />

    <gradient
        android:angle="90"
        android:startColor="@color/colorPrimary"
        android:endColor="@android:color/black" />

    <stroke android:color="@color/colorAccent"
        android:width="10dp"/>

    <corners android:radius="10dp" />

</shape>

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval">

    <size android:width="100dp"
        android:height="100dp" />

    <gradient
        android:angle="90"
        android:startColor="@color/colorPrimary"
        android:endColor="@android:color/black" />

    <stroke android:color="@color/colorAccent"
        android:width="10dp"
        android:dashWidth="10dp"
        android:dashGap="1dp"/>

</shape>

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="ring"
    android:innerRadius="25dp"
    android:thickness="25dp"
    android:useLevel="false">

    <size android:width="100dp"
        android:height="100dp" />

    <solid android:color="@color/colorPrimary" />

</shape>

 

 


 

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="ring"
    android:innerRadius="40dp"
    android:thickness="10dp"
    android:useLevel="false">

    <size android:width="100dp"
        android:height="100dp" />

    <solid android:color="@color/colorPrimary" />

</shape>

 

 

Tistory 코드 블록을 썼는데 글쓸때는 제대로 표시하고 완료된 글은 깨지는건 무엇?

 

'창고' 카테고리의 다른 글

DP(Device Independence Pixel)?  (0) 2019.06.09
프로그래밍 용어 정리  (0) 2019.05.27
2019 드로이드 나이츠  (0) 2019.04.26
드로이드나이츠(Droid Knights) 2018  (0) 2018.06.10
Googl I/O 2017 Extended in Seoul  (0) 2017.11.10

+ Recent posts