Advertisement
Guest User

QPUI Q&A

a guest
Jun 18th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. RelativeLayout layout = (RelativeLayout) view.findViewById(R.id.card_view_one); // id fetch from xml- If the id is different rename the id.
  2. ShapeDrawable rectShapeDrawable = new ShapeDrawable(); // pre defined class
  3.  
  4. // get paint
  5. Paint paint = rectShapeDrawable.getPaint();
  6.  
  7. // set border color, stroke and stroke width
  8. paint.setColor(Color.GRAY);
  9. paint.setStyle(Style.STROKE);
  10. paint.setStrokeWidth(1); // you can change the value to make it thicker. But 1 should be more appropriate.
  11. layout.setBackgroundDrawable(rectShapeDrawable);
  12.  
  13. QPUI - Krishneelg3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement