Reputation: 644
I have been searching on how to draw a border line that has shorter length that it container for few days. Basically I want to achieve below results i.e borders that do not have reach its edge.
So far this is what I have achieved:
I was thinking it is impossible and not supported by android drawable, until I found this post Howto draw a half border in xml android . It illustrates how to draw a C shape border by using android drawable layer list. I tried to modify and fit into my purpose, but I cannot achieve the expected result
I am not good in android drawable and please let me know if you have any idea.
Upvotes: 1
Views: 114
Reputation: 169
First you take outer rectangle box and align to a layout, and then take inner lines separately and add them using inner layouts.
Inner layout align:
<View
android:layout_margin="5dp"
android:background="#9c9c9c"
android:layout_width="2dp"
android:layout_height="desired"/>
Upvotes: 1
Reputation: 504
<View
android:layout_margin="5dp"
android:background="#9c9c9c"
android:layout_width="2dp"
android:layout_height="@dimen/view_sise"/>
It will look like this.
Upvotes: 1