Android之字形布局 [英] Android Zig-Zag layout
本文介绍了Android之字形布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在Android中创建收据布局.这个想法很简单,矩形的布局带有锯齿形的顶部.
I'm in need of creating a receipt layout in Android. The idea is very simple, a rectangle layout with a zigzag top.
即使是,我也尝试过虚线,但无济于事.
Even, i have tried dashed line but nothing working.
<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之字形布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文