Currently I can set the background
of my TextView
with this drawable, and it works perfectly fine for borders on all four sides.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="2dp"
android:color="@color/border_color" />
</shape>
However, I only want this border for top and bottom. Is there a way to modify the existing the drawable to achieve it? I know there are some answers using <layer-list>
, but is that the only way?