There is a standard button, in the backgound I added @ drawable / selector_dark The color of the button changes, but there is no rounding at the corners, tell me please, what is wrong?
Here is the XML @ drawable / selector_dark
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/colorPrimaryDark" android:state_pressed="true"> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" /> </shape> </item> <item android:drawable="@color/colorPrimaryDarkLight"> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <corners android:bottomLeftRadius="10dp" android:bottomRightRadius="10dp" android:topLeftRadius="10dp" android:topRightRadius="10dp" /> </shape> </item> </selector> Just in case XML activity
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingLeft="40dp" android:paddingRight="40dp" tools:context="com.example.user.scan.MainActivity" android:background="#28313C" android:paddingTop="40dp" android:paddingBottom="40dp"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_alignParentTop="true" android:layout_alignParentStart="true" android:background="@drawable/rectangle" android:padding="10dp" android:orientation="vertical" android:layout_weight="1"> <Button android:text="Новая инвентаризация" android:layout_width="match_parent" android:layout_alignParentTop="true" android:layout_alignParentStart="true" android:id="@+id/button" android:layout_alignParentEnd="true" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginBottom="30dp" android:background="@drawable/selector_dark" android:textColor="@android:color/background_light" android:layout_marginTop="15dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" /> <Button android:text="Список инвентаризаций" android:layout_width="match_parent" android:id="@+id/button2" android:layout_below="@+id/button" android:layout_alignParentStart="true" android:layout_alignParentEnd="true" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginBottom="30dp" android:background="@drawable/selector_dark" android:textColor="@android:color/background_light" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" /> <Button android:text="Загрузить данные" android:layout_width="match_parent" android:id="@+id/button4" android:layout_below="@+id/button3" android:layout_alignParentStart="true" android:layout_alignParentEnd="true" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginBottom="30dp" android:background="@drawable/selector_dark" android:textColor="@android:color/background_light" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" /> <Button android:text="Настройки" android:layout_width="match_parent" android:id="@+id/button5" android:layout_below="@+id/button4" android:layout_alignParentStart="true" android:layout_alignParentEnd="true" android:layout_height="wrap_content" android:layout_weight="1" android:layout_marginBottom="30dp" android:background="@drawable/selector_dark" android:textColor="@android:color/background_light" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" /> <Button android:text="Тест сканера" android:layout_width="match_parent" android:id="@+id/button7" android:layout_below="@+id/button5" android:layout_alignParentStart="true" android:layout_alignParentEnd="true" android:layout_height="wrap_content" android:layout_weight="1" android:background="@drawable/selector_dark" android:textColor="@android:color/background_light" android:layout_marginBottom="15dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" /> </LinearLayout> </RelativeLayout>