I want to change the button shape with round edges but somehow it does not work when I define it in my styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="ButtonStyle">
<item name="android:textColor">#00FFFF</item>
<item name="android:shape">rectangle</item>
<item name="android:bottomRightRadius">7dp</item>
<item name="android:bottomLeftRadius">7dp</item>
<item name="android:topRightRadius">7dp</item>
<item name="android:topLeftRadius">7dp</item>
</style>
</resources>
main.xml button
<Button
android:id="@+id/button4"
style="@style/ButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginRight="31dp"
android:layout_toLeftOf="@+id/button3"
android:text="@string/sSettings" />
Only the Font Color is changed.
What am I doing wrong?
You have to declare a background drawable for the button.
Do this in res/drawables. Make a new drawable file like this:
/res/drawable/button_drawable.xml
then in your layout do:
if you want to set each corner you can also do this with:
Have a look here for all the options.