Answers for "rounded corner shape in xml android"

1

round corner imageview android

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.makeramen:roundedimageview:2.3.0'
}
Posted by: Guest on April-25-2020
0

set top corner of shape radius programmatically android

GradientDrawable shape =  new GradientDrawable();
 shape.setCornerRadius( 8 );

 // add some color
 // You can add your random color generator here
 // and set color
 if (i % 2 == 0) {
  shape.setColor(Color.RED);
 } else {
  shape.setColor(Color.BLUE);
 }

 // now find your view and add background to it
 View view = (LinearLayout) findViewById( R.id.my_view );
 view.setBackground(shape);
Posted by: Guest on April-19-2020

Code answers related to "rounded corner shape in xml android"

Browse Popular Code Answers by Language