I am implementing an AI chat application and aiming to achieve ChatGPT-like behavior. Specifically, when a new message is sent, the ScrollView should automatically scroll to the top to display the latest message.
I am currently using the scrollTo method for this purpose, but the behavior is inconsistent—sometimes it works as expected, and other times it does not. I’ve noticed that this issue has been reported in multiple places, which suggests it may be a known SwiftUI limitation.
I’d like to know:
Has this issue been fixed in recent SwiftUI versions, or does it still persist?
If it still exists, is there a reliable solution or workaround that anyone can recommend?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
I want to know if I can implement ads in my tvOS apps. If any documents are available from Apple on this topic, please send me the link. Thanks.
I'm developing an Apple TV OS app using SwiftUI. I'm encountering an issue with the color of the tab item. I want the color of the tab item to turn green when focused; for instance, when the tab item is selected, its background color should be green. Below is my current code, but it's not working. I've tried several other approaches, but none have worked.
struct ContentView: View {
@State private var selectedTab = 0
var body: some View {
ZStack(alignment: .topLeading){
TabView(selection: $selectedTab) {
HomeView()
.tabItem {
AppColors.gradientColor1
Label("Home", image: "home-dash")
}
.tag(0)
ProductsView()
.tabItem {
Label("Products", image: "open box-search")
}
.tag(1)
SearchView()
.tabItem {
Label("Search", image: "search")
}
.tag(2)
}
.accentColor(Color.green)
.background(.black)
Image("amazontabbarlogo")
}
}
}