Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. <View
  2. android:id="@+id/my_view"
  3. android:elevation="4dp"
  4. android:layout_width="100dp"
  5. android:layout_height="100dp"
  6. android:layout_gravity="center"
  7. android:background="@android:color/white"/>
  8.  
  9. View view = findViewById(R.id.my_view);
  10. view.setClipToOutline(true);
  11. view.setOutlineProvider(new ViewOutlineProvider() {
  12. @Override
  13. public void getOutline(View view, Outline outline) {
  14. outline.setOval(0, 0, 200, 200);
  15. }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement