Answers for "android view set border programmatically"

0

android view set border programmatically

//use a GradientDrawable with only one color set, to make it a solid color
    GradientDrawable border = new GradientDrawable();
    border.setColor(0xFFFFFFFF); //white background
    border.setStroke(1, 0xFF000000); //black border with full opacity
    if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
      TitleLayout.setBackgroundDrawable(border);
    } else {
      TitleLayout.setBackground(border);
    }
Posted by: Guest on April-26-2020

Code answers related to "android view set border programmatically"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language