Files
SwiftUI/Examples/Jike/SwiftUI_Jike/Cell/CategoryRow.swift
Ivan Vorobei 27a7f9fae6 Add Jike
2019-06-06 22:36:07 +03:00

61 lines
1.5 KiB
Swift
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
See LICENSE folder for this samples licensing information.
Abstract:
A view showing a scrollable list of landmarks.
*/
import SwiftUI
struct CategoryRow: View {
var items: [ZoneModel]
var body: some View {
VStack(alignment: .leading) {
ScrollView(showsHorizontalIndicator: false) {
HStack(alignment: .top, spacing: 0) {
ForEach(self.items.identified(by: \.id)) { zone in
CategoryItem(zone: zone)
}
}
}
}
}
}
struct CategoryItem: View {
var zone: ZoneModel
var body: some View {
VStack(alignment: .center) {
VStack{
Color.white
.frame(width:65,height:65)
.border(Color(red: 218.0/255.0, green: 218.0/255.0, blue: 218.0/255.0),width: 3,cornerRadius: 15)
.cornerRadius(15)
zone
.image(forSize: 55)
.renderingMode(.original)
.cornerRadius(10)
.padding(.top,-68)
}
Text(zone.name)
.frame(width: 65, height: 20, alignment: .center)
.font(Font.system(size: 12))
.padding(.top, -8)
}
.padding(.trailing, -5)
.padding(.leading, 10)
}
}
#if DEBUG
struct CategoryRow_Previews: PreviewProvider {
static var previews: some View {
CategoryRow(items: zonnData)
}
}
#endif