I\'m new in Android development and I\'m trying to draw a line inside my yellow RelativeLayout from bottom left corner to top right corner.
I\'ve added a layer-list>
You should use VectorDrawable path to draw line inside yellow RelativeLayout from bottom left corner to top right corner. Your diagonal_line.xml should be like (assume line color is blue #0000FF and line width is 4):
(absolute dimensions not important, because vector will be rescaled for RelativeLayout size). Your styles.xml should include section
as you wrote, and in case you cannot use backgroundTint in your {your_layout}.xml file, you should set solid colored background (android:background="#FFDC7F") for your Relativelayout and put "dummy" View with diagonalStyle (style="@style/diagonalStyle") over it. Something like that:
As result, you should give something like that:
More path tutorial here.