mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-20 15:51:37 +02:00
Add Jike
This commit is contained in:
40
Examples/Jike/SwiftUI_Jike/Cell/ChatCell.swift
Executable file
40
Examples/Jike/SwiftUI_Jike/Cell/ChatCell.swift
Executable file
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// ChatCell.swift
|
||||
// SwiftUI_Jike
|
||||
//
|
||||
// Created by alexyang on 2019/6/5.
|
||||
// Copyright © 2019 alexyang. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ChatCell : View {
|
||||
var imageName:String
|
||||
var title:String
|
||||
var subTitle:String
|
||||
var body: some View {
|
||||
HStack(alignment: .center){
|
||||
CircleImage(imgName:imageName)
|
||||
VStack(alignment: .leading){
|
||||
Text(title)
|
||||
.bold()
|
||||
.padding(.top, 4)
|
||||
Text(subTitle)
|
||||
.color(Color.gray)
|
||||
.padding(.bottom, 8)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
.padding(.horizontal, 15)
|
||||
.frame(height: 60)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct ChatCell_Previews : PreviewProvider {
|
||||
static var previews: some View {
|
||||
ChatCell(imageName: "chat_box",title: "一条虫",subTitle: "瓦恁出来挨打")
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user