Closed wscqs closed 1 year ago
I have a demand is: ai reply is joining together to markdown, word by word and then have always scroll at the bottom of the requirements, so I hope to I can accept markdown height changes to the callback
我有一个需求是:ai回复是拼markdown的,一个字一个字的然后一直在底部滚动的需求,所以希望能接受markdown高度变化回调
你好兄弟,这个问题你解决了吗,我有遇到过,交流一下
我有一个需求是:ai回复是拼markdown的,一个字一个字的然后一直在底部滚动的需求,所以希望能接受markdown高度变化回调
你好兄弟,这个问题你解决了吗,我有遇到过,交流一下
自己解决方案不好,不准确。 还是等作者看能不能弄个回调
Closing this as invalid. Please use Discussions for questions, ideas and feature requests.
struct ContentView: View { var body: some View { Text("Hello, World!") //Markdown .background(GeometryReader { geometry in Color.clear .preference(key: ViewHeightKey.self, value: geometry.size.height) }) .onPreferenceChange(ViewHeightKey.self) { height in print("The view height is: (height)") //Markdown all is 0 } } }
struct ViewHeightKey: PreferenceKey { static var defaultValue: CGFloat = 0 static func reduce(value: inout CGFloat, nextValue: () -> CGFloat) { value = nextValue() } }