Android/실전 TIP

ListView 항목 글자크기, 글자색 변경

Dev-Drake 2019. 3. 21. 17:55
반응형
// layout 폴더에 memolist_type.xml로 파일 생성하여 아래 내용 추가
<?xml version="1.0" encoding="utf-8"?>
<TextView 
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/TxtMemoListType"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:textColor="#000000" 
    android:textSize="20dp"
    >
</TextView>
 
 
// 소스에서 어댑터로 리스트뷰 연결시에 타입을 아까 만든것으로 지정
 ArrayAdapter<String> Adapter;
 Adapter = new ArrayAdapter<String>(this, R.layout.memolist_type,  arMemoList);
 mListMemo.setAdapter(Adapter); 
 
반응형