开发者

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?


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


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>


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜