Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a 3d shaped button in android [closed]


I was trying to create a button similar in look to the round buttons over here -
http://livetools.uiparade.com/index.html
(every button looks like it is inside an immersed section) I had it by placing the button
in a circle background and giving them both a little gradient that didnt end up the same
though I got this result -

enter image description here

(I will upload my code once I can) how can I achieve that same look?

like image 589
crazyPixel Avatar asked Apr 22 '14 11:04

crazyPixel


1 Answers

Go to this link and Generate Custom 3D button.

http://angrytools.com/android/button/

buttonshape.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
<corners
android:radius="30dp"
/>
<gradient
android:gradientRadius="45"
android:centerX="35%"
android:centerY="50%"
android:startColor="##4CAB0B"
android:endColor="#004507"
android:type="radial"
/>
<padding
android:left="0dp"
android:top="0dp"
android:right="0dp"
android:bottom="0dp"
/>
<size
android:width="270dp"
android:height="60dp"
/>
<stroke
android:width="3dp"
android:color="#0B8717"
/>
</shape>

Button Code

<Button
android:id="@+id/angry_btn"

android:text="Button"
android:textColor="#FFFFFF"
android:textSize="30sp"

android:layout_width="270dp"
android:layout_height="60dp"
android:background="@drawable/buttonshape"
android:shadowColor="#A8A8A8"
android:shadowDx="3"
android:shadowDy="2"
android:shadowRadius="8"
/>
like image 72
Droidgeek Avatar answered Sep 23 '22 14:09

Droidgeek