Increase font size of RecyclerView items

user3206911 :

I have a navigation bar with RecyclerView that has different items. I wish to change the font size of it. Here is the code for navigation_menu.xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/app_background"
    android:textSize="30sp"
    android:fillViewport="true">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <include layout="@layout/nav_header_main" />

        <android.support.v7.widget.RecyclerView
            android:id="@+id/recyclerView_main"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="5dp"
            android:layout_marginStart="5dp"
            android:layout_marginTop="5dp" />

    </LinearLayout>

</ScrollView>
Euphoria Celestial :

First and easiest way i think about is change the font size directly in your single item. But if for some reason you dont want to do so, try to read this: Android change TextView textSize on RecyclerView adapter from Activity

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=109936&siteId=1