How do I programmatically set the background color gradient on a Custom Title Bar?
To do this in code, you create a GradientDrawable. The only chance to set the angle and color is in the constructor. If you want to change the color or angle, just create a new GradientDrawable and set it as the background View layout = findViewById(R.id.mainlayout); GradientDrawable gd = new GradientDrawable( GradientDrawable.Orientation.TOP_BOTTOM, new int[] {0xFF616261,0xFF131313}); … Read more