adaptive_card_layout

CardView 是一个功能丰富的 SwiftUI 组件,用于以卡片格式显示视图集合。它支持网格和水平滚动布局,并包含可选的缩放效果。

功能

水平滚动

Screenshot 2024-07-09 at 6 40 04 PM Screenshot 2024-07-09 at 6 40 41 PM Screenshot 2024-07-09 at 6 41 07 PM

垂直滚动视图

Screenshot 2024-07-09 at 6 41 43 PM Screenshot 2024-07-09 at 6 42 06 PM Screenshot 2024-07-09 at 6 42 29 PM

属性

安装

用法

步骤 1

import SwiftUI

struct CustomView1: View {
    
    var text: String
    var color: Color 
    var image: String
    
    var body: some View {
        VStack(alignment:.center) {
            Text(text)
                .font(.title)
                .foregroundColor(.white)
            Image(systemName: image)
                .resizable()
                .frame(width: 50, height: 50)
                .foregroundColor(.yellow)
                
        }
        .frame(width: 180, height: 300)
        .background(color)
        .cornerRadius(10)
        .padding()
    }
}

步骤 2

步骤 3

CardView(viewsArray: $viewsArray, scale: true, frameWidth: 180, frameHeight: 300,additionalFrameHeight: 30, gridView: $isGridView, RowOrcolumnNo: $columnNo) { indexNo in
print(indexNo)
}

贡献

欢迎任何贡献!对于重大更改,请先打开一个 issue 讨论您想要更改的内容。

请确保适当地更新测试。

作者

反馈

如果您有任何反馈,请通过 techmatrix@softsuave.com 联系我们