JAVA/android_studio
2024. 3. 14. 09:43
https://stackoverflow.com/questions/20456393/how-to-change-text-size-of-listview
how to change text size of listview
I am using List Activity to retrieve data from SQLITE. But I can not set the font size of list view. Please help me. public class CartList extends ListActivity { private ArrayList<String>
stackoverflow.com
- source code :
Go into layout folder and create a new xml file named mytextview.xml(whatever you want to name it)
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:paddingTop="2dip"
android:paddingBottom="3dip"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="12dp" />
in the code
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, results));
change it to
setListAdapter(new ArrayAdapter<String>(this,
R.layout.mytextview, results));
'JAVA > android_studio' 카테고리의 다른 글
| ListView 의 아이템으로 두가지 이상의 View사용하기 (0) | 2024.03.26 |
|---|---|
| 안드로이드 벡터 패스(Vector Path) 그리기 (0) | 2024.03.14 |
| Bluetooth search (0) | 2024.02.18 |
| +-> Fragment , getActivity() (0) | 2023.10.15 |
| +-> ListView 사용하기 , RecyclerView (0) | 2023.10.15 |
