// // ProfileView.swift // duduji // // Created by ching on 2023/5/7. // import SwiftUI struct ProfileView: View { var body: some View { VStack(alignment: .leading) { // banner & avarta HStack { Color(.systemRed) } .frame(height: 192) // .ignoresSafeArea() // user stats HStack(alignment: .top, spacing: 12) { RoundedRectangle(cornerRadius: 6) .fill(Color.blue) .frame(width: 96, height: 96) .overlay( RoundedRectangle(cornerRadius: 6) .stroke(.gray.opacity(0.5), lineWidth: 2) ) .padding(.horizontal) .offset(y: -40) Spacer() VStack { Text("1234") .bold() .font(.title3) .foregroundColor(.cyan) Text("嘟文") .foregroundColor(.gray) } VStack { Text("1234") .bold() .font(.title3) .foregroundColor(.cyan) Text("关注") .foregroundColor(.gray) } VStack { Text("1234") .bold() .font(.title3) .foregroundColor(.cyan) Text("粉丝") .foregroundColor(.gray) } } .padding(.bottom, -50) .padding(.trailing) // user info HStack(alignment: .firstTextBaseline) { VStack(alignment: .leading, spacing: 6) { Text("科代") .font(.title3) .bold() Text("@Kedai") .foregroundColor(.gray) HStack(spacing: 2) { Image(systemName: "calendar") Text("加入于 2021 年 11 月 12 日") } .foregroundColor(.gray) .font(.caption) } .padding() } Spacer() } } } struct ProfileView_Previews: PreviewProvider { static var previews: some View { ProfileView() } }