Post

Replies

Boosts

Views

Activity

Reply to Unable to change TabView's background color
Hello, Yes I tried them all. Most of those answers are about changing the color of the TabView bar, not the background of the TabView. Here is what I tried: Added the following to both init() and .onAppear() let appearance = UITabBarAppearance() appearance.configureWithTransparentBackground() appearance.backgroundColor = .clear UITabBar.appearance().standardAppearance = appearance Background modifier TabView{...}.background(.clear) Toolbar modifier TabView{...}.toolbarBackground(.clear, for: .tabBar) TabView{...}.toolbarBackground(.visible, for: .tabBar) None of the above worked. The background for TabView remained white (or black if the device has Dark Mode enabled). The only thing that allows me to make the background of the TabView clear is if I add this: TabView{...}.tabViewStyle(.page) TabView{...}.indexViewStyle(.page(backgroundDisplayMode: .always)) But this then changes the TabView behavior to a page view. This is with Xcode 16.0, happening both in the Simulator and on device running on iOS 18.1.1.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’24
Reply to Unable to change TabView's background color
Hello, Yes I tried them all. Most of those answers are about changing the color of the TabView bar, not the background of the TabView. Here is what I tried: Added the following to both init() and .onAppear() let appearance = UITabBarAppearance() appearance.configureWithTransparentBackground() appearance.backgroundColor = .clear UITabBar.appearance().standardAppearance = appearance Background modifier TabView{...}.background(.clear) Toolbar modifier TabView{...}.toolbarBackground(.clear, for: .tabBar) TabView{...}.toolbarBackground(.visible, for: .tabBar) None of the above worked. The background for TabView remained white (or black if the device has Dark Mode enabled). The only thing that allows me to make the background of the TabView clear is if I add this: TabView{...}.tabViewStyle(.page) TabView{...}.indexViewStyle(.page(backgroundDisplayMode: .always)) But this then changes the TabView behavior to a page view. This is with Xcode 16.0, happening both in the Simulator and on device running on iOS 18.1.1.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to detect when Camera Control button pressed in iPhone 16
Hello, You use AVCaptureEventInteraction to detect when the camera button is pressed: https://developer.apple.com/documentation/AVKit/AVCaptureEventInteraction And this guide shows how to work with camera controls: https://developer.apple.com/documentation/avfoundation/capture_setup/enhancing_your_app_experience_with_the_camera_control
Replies
Boosts
Views
Activity
Oct ’24