Group Group Group Group Group Group Group Group Group

Your First iOS and SwiftUI App · Challenge: Styling the About Page | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4919757-your-first-ios-and-swiftui-app/lessons/45

It seems that setting fixedSize on the text will prevent the text from being cut off and the ellipsis being shown:

`Text("Hello World").fixedSize(horizontal: false, vertical: true)`

Correct me if I’m wrong :wink:

The bug seems to be fixed with 13.1

Using

.lineLimit(Int.max)

instead of

.lineLimit(nil)

did work for me.

1 Like

With:

.multilineTextAlignment(.center)

You can center the text

And with:
.lineSpacing(CGFloat)
You can set your padding

Hi guys! I tested this with Xcode 11.1, and it looks like .lineLimit(nil) once again works properly for the about page.

In addition, as @michielvg74 states, you’ll probably find it useful to center your text alignment so the second line in the text field looks nice.

I’ve added some author notes about this on the here for future reference: https://www.raywenderlich.com/4919757-your-first-ios-and-swiftui-app/lessons/45

In Xcode 11.2.1, the bug seems to be fixed without entering any extra code. But the alignment did change and makes it little bit strange.

I found Concatenating the first two Text into one long Text with ‘\n\n’ in between makes it looks better. There must be better way to deal with the alignment though.

Just as a note if someone gets stuck in study, in 11.2.1 .lineLimit(nil) or (Int.max) not working for me. But is seems like it works for some.

@lywang Do you still have issues with this?

@paulijr Does this work for you now?

Hello
I went back to that chapter, and it works fine now (Xcode version 11.3)

As of now, with XCode Version 11.2.1 the .lineLimit(nil) is not working for me. Also none of the other mentioned .lineLimit options worked either.
However, .multilineTextAlignment(.center) did the trick :slight_smile: