[#108][안드로이드] typekit 사용하지 않고 커스텀 폰트 설정하기
[안드로이드] typekit 사용하지 않고 커스텀 폰트 설정하기
1. font 폴더 만들고 사용할 ttf 파일을 font 폴더로 옮기기
(ttf파일 이름에 대문자가 있다면 소문자로 바꿔주기)
2. Font resource file 클릭 -> font_family.xml 생성
3. font_family.xml 작성
| 
<?xml version="1.0" encoding="utf-8"?> 
<font-family xmlns:android="http://schemas.android.com/apk/res/android"> 
    <font 
        android:fontStyle="normal" 
        android:font="@font/nanumsquarel" 
        /> 
</font-family> | cs | 
4. 적용
| 
<EditText 
            android:fontFamily="@font/nanumsquarel" 
            android:layout_width="match_parent" 
            android:layout_height="280dp" 
            android:id="@+id/write_class_content" 
            android:textSize="15dp" 
            android:textColorHint="@color/black" 
            android:hint="글 내용을 입력해주세요." 
            android:textColor="@color/black" 
            android:background="@drawable/editbox_rectangle" 
/> | cs | 
5. 결과물 (노란 박스 영역)


댓글
댓글 쓰기