Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase font size of RecyclerView items

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>
like image 503
user3206911 Avatar asked Nov 17 '22 01:11

user3206911


1 Answers

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

like image 84
Euphoria Celestial Avatar answered Apr 06 '23 16:04

Euphoria Celestial