Например, у меня вертикальная линейная компоновка с 2 кнопками, внутри которых android:layout_weight="1"
.Проблема в том, что если я добавлю новую строку в текст кнопки, используя
, и увеличу ее размер, эта кнопка станет больше другой.Как сделать так, чтобы кнопка не меняла свой размер при изменении размера текста?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00ACC1"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<Button
android:id="@+id/button18"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/colorofbuttons"
android:fontFamily="@font/architects_daughter"
android:text="Mom"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp"></Button>
<Button
android:id="@+id/button19"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/colorofbuttons"
android:ellipsize="end"
android:fontFamily="@font/architects_daughter"
android:maxLines="1"
android:text="My Name"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<Button
android:id="@+id/button20"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/colorofbuttons"
android:fontFamily="@font/architects_daughter"
android:text="Dad"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp" />
<Button
android:id="@+id/button21"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_weight="1"
android:background="@drawable/colorofbuttons"
android:fontFamily="@font/architects_daughter"
android:text="Girl"
android:textAllCaps="false"
android:textColor="#ffffff"
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>