我需要在 Android 中创建收据布局。这个想法很简单,顶部有锯齿形的矩形布局。
甚至,我试过虚线但没有任何效果。
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#FF00"
android:dashWidth="5dp"
android:dashGap="5dp" />
</shape>
最佳答案
试试这个:https://github.com/beigirad/ZigzagView
支持top
和bottom
之字形。
<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>
关于Android之字形布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40253841/