Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does adding a spacer truncate text even though there's room in the view?

Tags:

swiftui

I'm trying to add a spacer to fill the space between two different views of various stacks of text. When I add the spacer, the text gets truncated with "..." even though there is available room in the view for all the text.

I've tried removing the lineLimit of 1 and a variety of minLength's for the Spacer with no success

HStack{
                //Active player information
                if self.player.isHomeTeam {
                    ActiveOrNotIndicator(player: self.player)
                    PlayerSummary(player: self.player)
                    Spacer()
                    FantasyPointTotal(player: self.player)
                } else {
                    FantasyPointTotal(player: self.player)
                    Spacer()
                    PlayerSummary(player: self.player)
                    ActiveOrNotIndicator(player: self.player)
                }
        }

This truncates the PlayerSummary view's text like so

Here it is without the spacer

like image 656
mg_berk Avatar asked Sep 02 '25 09:09

mg_berk


1 Answers

This seems to be a bug in iOS 13.0. I have the same problem on iOS 13.0 devices. However, running the same code on iOS 13.1 (beta 4) works as expected.

like image 168
Kevin Avatar answered Sep 04 '25 11:09

Kevin