Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RelativeLayout layout = (RelativeLayout) view.findViewById(R.id.card_view_one); // id fetch from xml- If the id is different rename the id.
- ShapeDrawable rectShapeDrawable = new ShapeDrawable(); // pre defined class
- // get paint
- Paint paint = rectShapeDrawable.getPaint();
- // set border color, stroke and stroke width
- paint.setColor(Color.GRAY);
- paint.setStyle(Style.STROKE);
- paint.setStrokeWidth(1); // you can change the value to make it thicker. But 1 should be more appropriate.
- layout.setBackgroundDrawable(rectShapeDrawable);
- QPUI - Krishneelg3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement