반응형
    
    
    
  https://developer.android.com/studio/write/draw9patch?hl=ko
https://github.com/mike-jung/DoItAndroidRev8/tree/master/part2/chapter07/SampleNinePatch/app/src/main/res/drawable
이미지 파일 자료
나인 패치(Nine Patch)는 이미지가 늘어나거나 줄어들 때 생기는 이미지 왜곡을 해결하는 방법을 정의하는 것
파일 확장자 앞에 '.9'를 붙여야 한다
activity_main.xml
<?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:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".MainActivity">
    <Button
        android:id="@+id/button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_01"
        android:text="SMALL" />
    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_01"
        android:text="MEDIUMMEDIUMMEDIUM" />
    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_01"
        android:text="LONGLONGLONGLONGLONGLONGLONGLONGLONG" />
    <Button
        android:id="@+id/button4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_02"
        android:text="SMALL" />
    <Button
        android:id="@+id/button5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_02"
        android:text="MEDIUMMEDIUMMEDIUM" />
    <Button
        android:id="@+id/button6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/button_image_02"
        android:text="LONGLONGLONGLONGLONGLONGLONGLONGLONG" />
</LinearLayout>

반응형
    
    
    
  '안드로이드' 카테고리의 다른 글
| 새로운 레이아웃 만들기, 카드뷰 넣기 (0) | 2021.10.26 | 
|---|---|
| 새로운 뷰 만들기 (0) | 2021.10.26 | 
| 외부 라이브러리를 이용한 위험 권한 자동 부여 (0) | 2021.10.26 | 
| 위험 권한 부여 (0) | 2021.10.22 | 
| 브로드캐스트 (0) | 2021.10.22 |