Skip to content

Instantly share code, notes, and snippets.

@alkjez
Created January 5, 2018 20:58
Show Gist options
  • Save alkjez/f821a61097874d28ade3cf03cb280aab to your computer and use it in GitHub Desktop.
Save alkjez/f821a61097874d28ade3cf03cb280aab to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<!-- View background color -->
<solid
android:color="#FF6E00" >
</solid>
<!-- The radius makes the corners rounded -->
<corners
android:radius="20dp">
</corners>
</shape>
<TextView
android:text="hi man, how are you?"
android:background="@drawable/rounded_rectangle_orange"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="8dp"
android:textColor="#ffffff"
android:layout_marginTop="4dp"/>
@ng-pabbu
Copy link

ng-pabbu commented Apr 1, 2018

Error shown as "Multiple root tags" when copied this file to Andriod Studio. Any modifications needed to this?

@laundy
Copy link

laundy commented Apr 12, 2018

The TextView should be in another file because it's referencing drawable/rounded_rectangle_orange (the shape part). For me it's working then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment