2 Steps to create oval shape textview in android



Step 2: Use text shape file for your wanted textview

For example, you want to a textview be oval shape ,you can do like this:


// create a textview

TextView text = new TextView(this);</pre>
mTextView.setText("This is a text");
mTextView.setTextSize(18);

// set up its background resource

mTextView.setBackgroundResource(R.drawable.floatwaring_text);
mTextView.setPadding(20,10,20,10);

Then run this android project, you will see effect.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>