How to make a Button appear like a TextView in Android?
Hello all…..
This is a simple trick where we can make the Button appear like a TextView in Android.
This is done by setting the background of Button to null like this.
b.setBackgroundDrawable(null);
This is the xml that contains the button.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
android:textColor="#FFF"
android:id="@+id/but"
/>
</LinearLayout>
Link to this post!