I want to implement this image
how can I ninepatch exactly this ??
There is one constraint with android 9-patch : the content area defined by right and bottom borders must be continuous (i.e. you can only have one segment on right and bottom border).
On the other hand you can have multiple stretchable area defined by segments on the top and left borders.
In your case :
for the stretchable areas :
draw one segment on the left border
draw two segments (of the same lenght) on top border (symetric around the vertical divider but don't include the vertical divider in them).
for the content area:
For the content:
Hope this help.
Result :
I use your plan but result is this
when my text increase Textbox height don't increase
how can fix that ?
I don't think it's linked to the 9-patch image. It's more likely related to the textView.
try : on the textView
android:layout_height="WRAP_CONTENT"
on the linear layout
android:layout_height="WRAP_CONTENT"
LinearLayout
allows you to specify dividers between its children. So you need to:
TextView
s inside a horizontal LinearLayout
LinearLayout
LinearLayout
:
android:divider="drawable_resource"
android:showDividers="middle"
This layout is also more flexible - you don't need to make another 9-patch in case you want 3 or more TextView
s
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With