开发者

How to draw borders for TextView created using Code not by XML in Android

开发者 https://www.devze.com 2023-01-19 23:43 出处:网络
I created my TextView through code rather than XML. I want to draw a border around theTextView.How can we do this using code rather than XML? I also wanted when I try to set开发者_运维问答Text for the

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 set开发者_运维问答Text for the TextView which is of some 2 lines then TextView is moving downward? plz also guide me to solve this problem. I will be waititng for reply .

Regarda,


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

0

精彩评论

暂无评论...
验证码 换一张
取 消