Zwiebel
Zwiebel

Reputation: 1615

Can I make "not original looking" buttons for Android in Eclipse?

I think, e.g. Curved buttons, or a circle button. If I can how?

Upvotes: 0

Views: 576

Answers (3)

neteinstein
neteinstein

Reputation: 17613

It's a bad ideia to round buttons by using a rounded background image. I say it by (bad) experience... when in different resolutions it will appear pixilated.

You should use a drawable, with a shape rounded created by you!

Something like (selector to have effects on press, on selected..):

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/greyer_bubble"
        android:state_pressed="true" />
    <!--When selected, use this -->
    <item android:drawable="@drawable/greyer_bubble"
        android:state_selected="true" />
    <!--When not selected, use that -->
    <item android:drawable="@drawable/green_bubble" />
</selector>

Example of one of the rounded buttons defined above.

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="@color/green" />
    <corners android:radius="12dp" />
</shape>

Upvotes: 1

Tushar Vengurlekar
Tushar Vengurlekar

Reputation: 7679

You can set image as background for button in layout design.

Upvotes: 0

Rohit Sharma
Rohit Sharma

Reputation: 13815

this is very simple

Select any image as a background of your button. either of circle or curved or any image you want.

For Click Effect see state list diagram on google . its like stting a xml as a background which say what image to choose for pressed , focussed and normal state

Upvotes: 2

Related Questions