Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change font size and arrow color? #27

Open
shahzad1 opened this issue Jul 23, 2020 · 4 comments
Open

How to change font size and arrow color? #27

shahzad1 opened this issue Jul 23, 2020 · 4 comments

Comments

@shahzad1
Copy link

Hi, is there any method to change font size and change arrow color?

@yasamisd
Copy link

Hi, is there any method to change font size and change arrow color?

Define a style in your app styles.xml

<style name="textAccent" parent="NumberPicker.EditTextStyle">
<item name="android:textColor">@color/colorAccent</item>
<item name="android:textSize">18sp</item>
<item name="android:textStyle">bold</item>
</style>

add this attribute to your xml code where you add NumberPicker
app:picker_editTextStyle="@style/textAccent"

@kewitschka
Copy link

kewitschka commented Mar 12, 2021

How can I change the arrow color?

Update: Found the solution

res/layout/main_activity.xml

    <it.sephiroth.android.library.numberpicker.NumberPicker  
                       android:id="@+id/yearOfBirth"
                        style="@style/NumberPicker.None"
                        android:layout_width="150dp"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_horizontal"
                        android:progress="2000"
                        app:picker_editTextStyle="@style/numberPickerText"
                        app:picker_max="2020"
                        app:picker_min="1920"
                        app:picker_orientation="vertical"
                        app:picker_stepSize="1"
                        app:picker_tracker="exponential" />

res/values/themes/themes.xml

<resources>
    <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
        <item name="colorControlNormal">@color/white</item>
    </style>

    <style name="numberPickerText" parent="NumberPicker.EditTextStyle">
        <item name="android:textColor">@color/white</item>
    </style>

</resources>

@Azarnoyz
Copy link

@kewitschka Can you send full code with xml of view and style? I tried to change arrow color, but can`t

@kewitschka
Copy link

@Azarnoyz I updated my answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants