Note that there are some explanatory texts on larger screens.

plurals
  1. POButton with background image and corner radious in android
    primarykey
    data
    text
    <p>I am trying to make a button with a backl ground image. Again I want to apply some state style with selector xml. I have used this xml below as style and the other one as selector. But the background image is not showing up. Also I want to apply some corner radious to the button</p> <p>Please help.</p> <pre><code>&lt;style name="HomeMenuButton" parent="@android:style/Widget.Button"&gt; &lt;item name="android:gravity"&gt;center_vertical|center_horizontal&lt;/item&gt; &lt;item name="android:textColor"&gt;#FFFFFFFF&lt;/item&gt; &lt;item name="android:shadowColor"&gt;#FF000000&lt;/item&gt; &lt;item name="android:shadowDx"&gt;0&lt;/item&gt; &lt;item name="android:shadowDy"&gt;-1&lt;/item&gt; &lt;item name="android:shadowRadius"&gt;5&lt;/item&gt; &lt;item name="android:textSize"&gt;16dip&lt;/item&gt; &lt;item name="android:textStyle"&gt;bold&lt;/item&gt; &lt;item name="android:background"&gt;@drawable/button_back&lt;/item&gt; &lt;item name="android:focusable"&gt;true&lt;/item&gt; &lt;item name="android:clickable"&gt;true&lt;/item&gt; &lt;/style&gt; &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;selector xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;item &gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;stroke android:width="2dp" android:color="@color/red" /&gt; &lt;solid android:color="#FFFFFFFF"/&gt; &lt;padding android:left="5dp" android:top="2dp" android:right="5dp" android:bottom="2dp" /&gt; &lt;corners android:radius="15dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;item android:state_pressed="true" &gt; &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;stroke android:width="2dp" android:color="@color/red" /&gt; &lt;solid android:color="@color/blue"/&gt; &lt;padding android:left="5dp" android:top="2dp" android:right="5dp" android:bottom="2dp" /&gt; &lt;corners android:radius="15dp" /&gt; &lt;/shape&gt; &lt;/item&gt; &lt;/selector&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload