Сделал кнопку в ней текст , но когда запускаю на экранах входящих в диапазон Small, например Nexsus_s, текст становится в две строки. На сколько я знаю размер текста не спроста считается в sp
и должен сам масштабироваться. Ну выходит дело в том, что моя кнопка позволяет тексту расползтись. Если вместо 28 dp высоту установлю по содержимому, то кнопка становится слишком большая.
` <RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_weight="1"
android:background="@drawable/anim_button"
android:button="@android:color/transparent"
android:gravity="center"
android:text="@string/button_sort_name3"
android:textSize="14sp" />`
Вот вся верстка целиком:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/relativeLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ListView
android:id="@+id/ListView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/linearLayout2" />
<TextView
android:id="@+id/ListOfCurrencies"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/linearLayout3"
android:textSize="18sp" />
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_alignParentTop="false"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textView2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="@string/currency"
android:textSize="24sp" />
<Spinner
android:id="@+id/spinnerCurrency"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_weight="1"
android:gravity="center" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@+id/ListOfCurrencies"
android:layout_alignParentLeft="false"
android:layout_alignParentStart="false"
android:layout_marginBottom="80dp"
android:orientation="horizontal">
<TextView
android:id="@+id/textDate"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="5dp"
android:layout_weight="1"
android:text="@string/date"
android:textSize="24sp" />
<TextView
android:id="@+id/Current_Date"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:onClick="onClickDate"
android:textColor="@android:color/holo_orange_dark"
android:textSize="24sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="106dp"
android:orientation="horizontal"
android:layout_below="@+id/linearLayout1"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true">
<RadioGroup
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_weight="1"
android:background="@drawable/anim_button"
android:button="@android:color/transparent"
android:gravity="center"
android:text="@string/button_sort_name1" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_weight="1"
android:background="@drawable/anim_button"
android:button="@android:color/transparent"
android:gravity="center"
android:text="@string/button_sort_name2" />
<RadioButton
android:id="@+id/radioButton3"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:layout_weight="1"
android:background="@drawable/anim_button"
android:button="@android:color/transparent"
android:gravity="center"
android:text="@string/button_sort_name3" />
</RadioGroup>
</LinearLayout>
<fragment
android:id="@+id/fragment"
android:name="mobiledimension.exchangerates.FragmentAct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/ListView"
android:layout_centerHorizontal="true"
android:layout_marginBottom="44dp" />
</RelativeLayout>
Получается на маленьком экране вот так : https://gyazo.com/33a89a7d85c5b06f5affadc6a918fff1
А на больших: https://gyazo.com/1d24ac4d8f0d463f74b4f092aadfab24