How to make List reversed in SwiftUI

后端 未结 2 467
栀梦
栀梦 2021-02-06 15:52

I\'m new in SwiftUI, trying to make something like reverse in Android LinearLayoutManager

mess         


        
2条回答
  •  难免孤独
    2021-02-06 16:07

    @cipais's answer worked well. https://stackoverflow.com/a/61036551/12208004

    List(chatController.messages, id: \.self) { message in
        MessageView(message.text, message.isMe)
            .rotationEffect(.radians(.pi))
            .scaleEffect(x: -1, y: 1, anchor: .center)
    }
    .rotationEffect(.radians(.pi))
    .scaleEffect(x: -1, y: 1, anchor: .center)
    

提交回复
热议问题