android - How to make a zig-zag layout? -


i want create zig-zag layout same following attached image:

zig-zag

i tried lot creating diagonal lines , arranging them icon couldn't make same.

i implemented diagonal lines of accepted answer following questions:

  1. diagonal line across view
  2. how rotate line in android xml?

however i'm stuck arrange lines icons same in image.

i created custom zigzaglayout.java file cater requirement. have update package name in 1st line. extends relativelayout, can use in layout-xmls other viewgroup class. once have instantiated layout, add child-views done relativelayout via addview(view child).

example code snippet dynamically created view:

zigzaglayout zigzaglayout = (zigzaglayout) findviewbyid(r.id.layout_zigzag); button btn = new button(this); btn.settext("test button"); btn.setlayoutparams(new relativelayout.layoutparams(relativelayout.layoutparams.wrap_content, relativelayout.layoutparams.wrap_content)); zigzaglayout.addview(btn); 

i've added few interfaces zigzaglayout easy interaction ability set connector-line stroke width, visibility, color, margins, etc.

try out , let me know if suffices requirement. cheers.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -