Reputation: 192
How do I create or download elegant/stylish buttons (Widgets) instead of using the simple buttons ?
Upvotes: 4
Views: 1709
Reputation: 448
If you want to make a legitimate, fully-implemented button skin, you make a state-list 9-patch drawable.
A 9-patch drawable is a standard drawable with sections that can be repeated; for instance, the top-left, top-center, top-right, middle-left and so on portions of a button.
(You can read in-depth here: http://developer.android.com/guide/topics/graphics/2d-graphics.html#nine-patch)
A state-list drawable is a drawable which changes its resource according to a particular state. In the case of a button normal, highlighted, and pressed are the states.
http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList
So you pretty much need to make three nine-patch drawables and a state-list drawable to hook up these three nine-patches.
A few other ways you could do it:
Upvotes: 8