Post

Replies

Boosts

Views

Activity

Reply to Segment control not working in visionOS
The solution I found that works is to in code remove any existing segments at run time then add them back again. After that the segment control works as expected below is some sample code: [self.segmentList removeAllSegments]; [self.segmentList insertSegmentWithTitle:NSLocalizedString(@"currenttab", @"") atIndex:0 animated:NO]; [self.segmentList insertSegmentWithTitle:NSLocalizedString(@"alltabs", @"") atIndex:1 animated:NO]; [self.segmentList insertSegmentWithTitle:NSLocalizedString(@"favorites_title", @"") atIndex:2 animated:NO];
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’24
Reply to Segment control not working in visionOS
You can recreate this issue by Creating a new app project in Xcode, I am using Xcode 15.3: Set the interface to storyboard and the language to objective c In the default storyboard, add a segment control with 3 segments. In my test project I added 2 segment controls one pined/anchored to the top of the view and the second control with not anchoring to see if it made a difference. No need to wire up any outlets Run the project using Apple Vision Pro target in the simulator on an actual device. Select the second or third segment, then select any other segment. That will cause focus to return to the first segment and no other taps/click/pinches will have any effect
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’24
Reply to Segment control not working in visionOS
My app use objective c not SwiftUI so the segment control is added to a view controller in interface builder and pinned to the top of the view controller with padding. The only code sets the title of the segments, sets the selected segment and listens to the value changed event. To debug if it was a code issue or maybe to see if I wired the control incorrectly, I added another segment control to the view in interface builder with 3 segments but I didn't create an outlet to access the control in code and I didn't link it to any events and I got the same behavior. I filed bug report 13678160 in the feedback assistant with a video attached, can you see this.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’24
Reply to Segment control not working in visionOS
The say a picture is worth a thousand words Step 1: the view loads with first tab selected by default: Steps 2: select segment #2, I get the value did change event with selectedSegmentIndex is 1 and segment #2 gets highlighted Step 3: select segment #3, I get the value did change even but selectedSegmentIndex is 0, the first segment gets highlighted but segment #3 should be highlighted Step 4: If select any segment 1, 2 or 3 then no value changed event is triggered and focus remains on segment #1 Said another way, after selecting a second segment, the control returns focus to segment #1 and seems to be non responsive. Hopefully the pictures and words paint a clearer picture.
Topic: App & System Services SubTopic: Core OS Tags:
Mar ’24