0

I have a PreferenceScreen but I want have it on big devices also, but the elements don't scale and I cannot change its size. On tablets it looks really small and I want make it bigger, how to do it?

This is how it looks right now: enter image description here

xml

<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"

    >

    <EditTextPreference
        android:defaultValue="0"
        android:key="longitudeList"
        android:numeric="signed|decimal"
        android:phoneNumber="false"
        android:selectAllOnFocus="true"
        android:singleLine="true"
        android:summary="@string/longitudeRange"
        android:textSize="100dp"
        android:title="@string/enterLong" />
    <EditTextPreference
        android:defaultValue="0"
        android:key="latitudeList"
        android:numeric="signed|decimal"
        android:phoneNumber="false"
        android:selectAllOnFocus="true"
        android:singleLine="true"
        android:summary="@string/latitudeRange"
        android:title="@string/enterLati" />

    <ListPreference
        android:defaultValue="10"
        android:entries="@array/refreshArray"
        android:entryValues="@array/refreshValues"
        android:key="refreshList"
        android:title="Select refresh time" />


</PreferenceScreen>
petey
  • 16,914
  • 6
  • 65
  • 97
Senio Vak
  • 87
  • 4
  • 11

1 Answers1

0

use sp for text size

            android:textSize="20sp"

From android documentation

When defining text sizes, however, you should instead use scale-independent pixels (sp) as your units (but never use sp for layout sizes). The sp unit is the same size as dp, by default, but it resizes based on the user's preferred text size.

For example, when you specify spacing between two views, use dp:

<Button android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/clickme"
    android:layout_marginTop="20dp" />

When specifying text size, always use sp:

<TextView android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:textSize="20sp" />
Deepu
  • 598
  • 6
  • 12