В моем приложении много кнопок с закругленными углами, но некоторые из моих кнопок не работают с любым фоном, не имеет значения, были ли скруглены углы или изменен цвет. Вот файл XML:
<?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:orientation="vertical"
android:background="@color/colorAppBackground"
tools:context=".activities.GameActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
android:weightSum="10">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
<TextView
android:id="@+id/textViewGameCategory"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="6"
android:gravity="center"
android:textSize="28sp"
android:textColor="@color/colorBlack"
tools:text="Gemälde"/>
<TextView
android:id="@+id/textViewGameCounter"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2"
android:gravity="center"
android:textSize="20sp"
tools:text="9/107"/>
</LinearLayout>
<View style="@style/Divider" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">
<TextView
android:id="@+id/textViewGameQuestion"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_weight="1.5"
android:gravity="center"
android:textSize="20sp"
android:textColor="@color/colorBlack"
tools:text="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam"/>
<ImageView
android:id="@+id/imageViewCardFlip"
android:layout_width="match_parent"
android:layout_height="0dp"
android:paddingStart="15dp"
android:paddingLeft="15dp"
android:paddingEnd="15dp"
android:paddingRight="15dp"
android:paddingBottom="15dp"
android:layout_weight="3.5"
android:src="@drawable/cover_quizgame" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:orientation="vertical"
android:layout_weight="5"
android:weightSum="2">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="@+id/buttonGameOptionOne"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:textSize="12sp"
android:gravity="center"
android:textAllCaps="false"
android:padding="3dp"
android:background="@drawable/btn_answer_rounded_corners" />
<Button
android:id="@+id/buttonGameOptionTwo"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:textSize="12sp"
android:gravity="center"
android:textAllCaps="false"
android:padding="3dp"
android:background="@drawable/btn_answer_rounded_corners" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<Button
android:id="@+id/buttonGameOptionThree"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:textSize="12sp"
android:gravity="center"
android:textAllCaps="false"
android:padding="3dp"
android:background="@drawable/btn_answer_rounded_corners" />
<Button
android:id="@+id/buttonGameOptionFour"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:layout_weight="1"
android:textSize="12sp"
android:gravity="center"
android:textAllCaps="false"
android:padding="3dp"
android:background="@drawable/btn_answer_rounded_corners" />
</LinearLayout>
<Button
android:id="@+id/buttonContinue"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="70dp"
android:layout_marginLeft="70dp"
android:layout_marginEnd="70dp"
android:layout_marginRight="70dp"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:background="@drawable/btn_continue_rounded_corners"
android:text="@string/singlegame_continue" />
<ProgressBar
android:id="@+id/progressBarSingleGame"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginStart="15dp"
android:layout_marginLeft="15dp"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="15dp"
android:layout_marginTop="15dp"
android:progressDrawable="@drawable/progressbar_greenprogress"
android:visibility="gone"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Кнопки с идентификатором «buttonGameOption *» установили фон «btn_answer_ounded_corners». В режиме предварительного просмотра углы скруглены, но при запуске приложения кнопки по-прежнему не имеют закругленных углов. Здесь файл XML
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<layer-list>
<item android:right="1dp" android:top="1dp" android:bottom="1dp" android:left="1dp">
<shape>
<corners android:radius="10dp"></corners>
<solid android:color="@color/colorNotAnswered"></solid>
</shape>
</item>
</layer-list>
</item>
</selector>
Может кто-нибудь сказать мне, как я могу это исправить?