HomeiOS DevelopmentHow you can make textual content span full width with out truncation...

How you can make textual content span full width with out truncation in Dynamic Island expanded view utilizing SwiftUI?


Anticipated:

How you can make textual content span full width with out truncation in Dynamic Island expanded view utilizing SwiftUI?

Curernt:

enter image description here

I am constructing a Dwell Exercise with Dynamic Island assist for my iOS app. Within the expanded view, I wish to show an icon on the left with two textual content labels stacked vertically to its proper: "cell" on high and identify string "Alejandro Ausejo" beneath it.

The Downside:
The identify string will get truncated as a result of the .main area does not have sufficient horizontal house. I want this textual content to increase horizontally and take up the complete accessible width (probably extending into the middle space beneath the Dynamic Island notch).

Code:

DynamicIsland {
  DynamicIslandExpandedRegion(.main) {
    HStack(spacing: 8) {
      CopilotDemoAppAsset.Belongings.icFluentCopilot20Color.swiftUIImage
        .body(width: 50, top: 50)
      VStack(alignment: .main, spacing: 2) {
        Textual content("cell")
          .font(.system(measurement: 15))
          .opacity(0.5)
          .lineLimit(1)
        Textual content("Alejandro Ausejo")
          .font(.system(measurement: 17))
          .lineLimit(1)
      }
    }
    .body(maxWidth: .infinity, alignment: .main)
  }
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments