开发者

Text not showing if image on background

开发者 https://www.devze.com 2023-03-05 22:52 出处:网络
i am tried set image on background of textview. All ok but .. when i \"setText(\"blyablya\")\" than text not showing. I am tried to use setBackgroundResource and setBackgroundDrawable... but always on

i am tried set image on background of textview. All ok but .. when i "setText("blyablya")" than text not showing. I am tried to use setBackgroundResource and setBackgroundDrawable... but always on background only image and i can't see text from TextView (((

Please can anyone help me ??

simple code :

//tit - TextView tit
tit.setText("blabla");
        tit.setTextColor(Color.BLACK);
        tit.setBackgroundDrawable(getResource开发者_开发技巧s().getDrawable(R.drawable.popup_title));

added after help : if normal drawable than all ok but if background drawable is a 9patch than this might help you.


If your background drawable is a 9patch, check that the content area (defined by bottom and right black lines) is wide enough to contain the text, because it might be hidden by the padding itself.

(thanks @Peter)

0

精彩评论

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