Skip to content Skip to sidebar Skip to footer

How To Draw Borders For Textview Created Using Code Not By Xml In Android

I created my TextView through code rather than XML. I want to draw a border around the TextView.How can we do this using code rather than XML? I also wanted when I try to setText

Solution 1:

Probably the easiest way to get a nice border to your text view would be to create a 9-patch image and set it as background to your text field. Just get padding right in your image and you have a border for your text view

I don't really understand your second question. Would setting your text field as a single line help? link to TextView API

Post a Comment for "How To Draw Borders For Textview Created Using Code Not By Xml In Android"