2

I need to achieve below attached image programatically, is there any way? I know how to draw rectangle in layer-list but for the particular zig-zag texture in bottom I don't have any idea enter image description here

Please help me to achieve this shape

Thanks in advance

Madhu
  • 1,780
  • 23
  • 47
  • 1
    you can set background which contain your zig-zag texture portion , about rest of your control ,take one linear layout and put your back button , signup and done textview programatically . or you can easily inflate your layout to ,then what is the issue? – Radhey Feb 27 '15 at 09:19

1 Answers1

5

to draw a dashed line you can use a shape

<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line">

<stroke
   android:color="#FF00"
   android:dashWidth="5dp"
   android:dashGap="5dp" />
</shape>

if you want to combine more than one shape then you can use a layer-list and define a shape for every item

Blackbelt
  • 156,034
  • 29
  • 297
  • 305
  • Hey I am trying to use this drawable as my ImageView Background But Nothing work – Key_coder Apr 24 '15 at 07:04
  • 2
    @Blackbelt I still can't understand how is the zigzag patterns achievable through using dashed lines. This answer is accepted and highly upvoted - but still unclear on usage. – dev Oct 26 '16 at 16:43
  • the op didn't want any zig-zag stuff. He wanted a dashed line, the one he showed in the question under the actionbar @SlowAndSteady – Blackbelt Oct 26 '16 at 16:44
  • @Blackbelt When I zoom into that image - the line under the actionbar is not a series of "dashes", but a series of "curves". I don't think this answer correctly resolves that, but perhaps I am misunderstanding something ? – dev Oct 26 '16 at 18:56
  • zig zas has no curves. As I said, the op wanted a dashed line @SlowAndSteady – Blackbelt Oct 26 '16 at 18:58
  • @Blackbelt All right, I think I am wrong. The question is ambiguous. The image does not match his requirement in text. – dev Oct 26 '16 at 19:01
  • The question is asked for zig-zag line, not dashed line. There is difference. Please zoom the OP image for clarity, it's not dashed line. – hkchakladar May 14 '21 at 18:50