skip to Main Content

I want to have a very minimal button that is is just a black rectangular box around text. What’s the easiest way to do this. Should I make images in Photoshop or just use styles? Can I use styles?

2

Answers


  1. You can use

    <Button
            android:id="@+id/button1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="#000000"
            android:textColor="#ffffff"
            android:text="Button" />
    

    in your layout file.

    Login or Signup to reply.
  2. <?xml version="1.0" encoding="utf-8"?>
    <shape xmlns:android="http://schemas.android.com/apk/res/android"
     android:shape="rectangle" android:padding="10dp">
     <solid android:color="#00FFFFFF"/>
    <stroke android:width="1dp" android:color="#000000" />
    </shape>
    

    create this drawable and set it as background of your button…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search