Android Zig-Zag layout

久未见 提交于 2019-11-28 09:29:47

Try with this: https://github.com/beigirad/ZigzagView

Support top and bottom Zigzag.

<ir.beigirad.zigzagview.ZigzagView
    android:layout_width="match_parent"
    android:layout_height="240dp"
    app:zigzagBackgroundColor="#8bc34a"
    app:zigzagElevation="8dp"
    app:zigzagHeight="10dp"
    app:zigzagShadowAlpha="0.9"
    app:zigzagSides="top|bottom"
    app:zigzagPaddingContent="16dp">

    // add child view(s)

</ir.beigirad.zigzagview.ZigzagView>

Hi you can use this library android-shape-imageview. And use transparent shape like this

End use library.

<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:siShape="@drawable/zigzag"
android:src="@drawable/neo"
app:siSquare="true"/>

You can change app:siShape="@drawable/zigzag" to desired shape. You can create other png shape.

Ravi Rupareliya

Create small triangle and use repeat background

repeat_background.xml

<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/imagename"
    android:tileMode="repeat" />

and use it in any view

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/repeat_background" />

refer this and this for more

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!