Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct MessageView : View {
- var body: some View {
- HStack {
- HStack(alignment: .center) {
- RoundImage(image: Image("turtlerock"))
- .frame(width: 35)
- .alignmentGuide(.bottomImageAndText) { d in
- d[.bottom]
- }
- VStack(alignment: .leading) {
- Text("AR demo from Apple site 🤣 AR demo from Apple site 🤣 AR demo from Apple site 🤣 AR demo from Apple site 🤣")
- .fontWeight(.regular)
- .padding(EdgeInsets(top: 10, leading: 10, bottom: 10, trailing: 10))
- .lineLimit(5)
- .border(Color.gray, width: 1, cornerRadius: 15)
- .layoutPriority(2)
- .alignmentGuide(.bottomImageAndText) { d in
- d[.bottom]
- }
- HStack {
- Image(systemName: "heart.fill")
- .foregroundColor(.red)
- RoundImage(image: Image("turtlerock"))
- .frame(height: 16)
- }
- .padding(.leading)
- }
- }.padding(EdgeInsets(top: 0, leading: 10, bottom:0 , trailing: 0))
- .layoutPriority(1)
- Spacer()} }
- }
- extension VerticalAlignment {
- private enum BottomImageAndText : AlignmentID {
- static func defaultValue(in d: ViewDimensions) -> Length {
- return d[.bottom]
- }
- }
- static let bottomImageAndText = VerticalAlignment(BottomImageAndText.self)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement