TextView tagTv=new TextView(mContext);
tagTv.setBackgroundResource(res);
tagTv.setPadding(ConvertUtils.dp2px(15),ConvertUtils.dp2px(5),ConvertUtils.dp2px(15),ConvertUtils.dp2px(5));
注意:设置的时候必须要把setPadding放在setBackgroundResource的后面才会起作用
TextView tagTv=new TextView(mContext);
tagTv.setBackgroundResource(res);
tagTv.setPadding(ConvertUtils.dp2px(15),ConvertUtils.dp2px(5),ConvertUtils.dp2px(15),ConvertUtils.dp2px(5));
注意:设置的时候必须要把setPadding放在setBackgroundResource的后面才会起作用
本文标题:Java创建TextView设置setPadding无效问题
本文链接:https://www.haomeiwen.com/subject/nxqbkftx.html
网友评论