Android的TextView设置padding无效

I finally found the problem I have to set the background first before setting the padding. Setting the padding then setting the background doesn't work

// does not work
tv.setPadding(20, 20, 20, 20);
tv.setBackgroundResource(R.drawable.border); // works
tv.setBackgroundResource(R.drawable.border);
tv.setPadding(20, 20, 20, 20);

原文地址:https://*.com/questions/18327498/setting-padding-for-textview-not-working

 
上一篇:django 过滤器、日日期格式化参数


下一篇:正则表达式:re--python核心编程(3),chapter 1