make my button style like the AlertDialog button Style

android

Solution

You can just do it with xml, like this:

Put this in drawable/border.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
   <solid android:color="#000000" />
   <stroke android:width="1dip" android:color="#333333"/>
</shape>

And then in your layout file:

<Button
    ...
    android:background="@drawable/border"
    android:textColor="#ffffff"
    android:textSize="13sp"
    ... />

Then you can just set your width & height to make it look great! :)

Edit: I would recommend to use this answer instead thought, much more better to use built-in Android-resources.

Problem

I want to make my buttons style like the following I want to implement these buttons with my custom view I mean without using the AlertDialog

Original source

Related problems