-4

I want to create a custom textView which looks like the following blue color sphere/ball :

Example

The color is to be supplied by the user. Don't know how to create this layout in android xml. Please help.

Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
  • I don't see how this could be TextView, or you are trying to only draw this sphere with another color? – Marek Sebera Jul 19 '13 at 10:03
  • actually i want to place text inside it. this will be the bg of the textView – bodhisattwa Jul 19 '13 at 10:04
  • could you provide image of how that textview would look like with text? – Marek Sebera Jul 19 '13 at 10:05
  • http://s24.postimg.org/m4zw82v0h/1352469911_icon_Copy.png – bodhisattwa Jul 19 '13 at 10:08
  • this will be the background of textview, on which i can place my text elements of different color. Other than this shape, can we create textView of custom shape (say, diamond shape, heart shape.. etc ?) – bodhisattwa Jul 19 '13 at 10:10
  • I think you can add it as the background and set the textView to be transparent.. or take a look at this http://developer.android.com/guide/topics/ui/themes.html and this http://stackoverflow.com/questions/9477336/how-to-make-custom-textview – Elior Jul 19 '13 at 10:25

1 Answers1

3

copy the image (.png format with transparency) to the drawable folder and in the xml set the textview property android:background="@drawable/your-image-name"

Goran Horia Mihail
  • 3,536
  • 2
  • 29
  • 40