【发布时间】:2014-06-07 09:22:35
【问题描述】:
谁能解释如何以编程方式为相对布局添加底部边框?
PS:我正在使用以下代码为相对布局添加边框:
RelativeLayout layout = (RelativeLayout) view.findViewById(R.id.borderEffect);
ShapeDrawable rectShapeDrawable = new ShapeDrawable();
Paint paint = rectShapeDrawable.getPaint();
paint.setColor(Color.GRAY);
paint.setStyle(Style.STROKE);
paint.setStrokeWidth(5);
layout.setBackgroundDrawable(rectShapeDrawable);
上面的代码为所有角落添加了边框,但我想为底部添加边框。
有什么方法或等效的方法可以做到这一点?
【问题讨论】:
标签: java android android-layout