기본 콘텐츠로 건너뛰기

Android, Rounded Button programmatically



GradientDrawable shape =  new GradientDrawable();
shape.setCornerRadius( 12 );
shape.setColor(Color.RED);
View view = ...
view.setBackground(shape);



ref : https://stackoverflow.com/questions/18391830/how-to-programmatically-round-corners-and-set-random-background-colors

댓글