Skip to main content
Filter by
Sorted by
Tagged with
0 votes
3 answers
96 views

I would like achieve the following: HCenter align blue and green boxes Leading align red and purple boxes Top align blue and red boxes VCenter align green and purple boxes The following SwiftUI ...
Andrei Herford's user avatar
1 vote
2 answers
124 views

I'm newish to SwiftUI and trying to understand how I can keep one view horizontally centered on the device screen, while anchoring an additional view to its trailing edge (without uncentering the ...
Kpmurphy91's user avatar
0 votes
2 answers
144 views

I have HStack with two views: Image and Text. I would like to align Image top but the text center on VerticalAlignment. However, specifying alignment .center for the Text does not do the trick , it is ...
SilKirss's user avatar
0 votes
2 answers
309 views

I have this custom cell. I have tried different approach to align "Skill Range" and "Time" by adding .alignmentGuide(.leading) to both "Skill Range" and "Time" ...
SwiftNewbie's user avatar
1 vote
1 answer
175 views

I want to create a SwiftUI Form with lines that have a key Text, a colon and a value Text. I want all the keys to be leading-aligned and all the values to be leading-aligned, like in this picture. Is ...
niklassaers's user avatar
  • 8,878
1 vote
2 answers
2k views

I want to use alignmentGuide to align center a Text view in ZStack to implement view as bellow, blue block is align traling, Text "abc" and "123" is align center of view. My code ...
mars's user avatar
  • 497
2 votes
1 answer
588 views

A typical problem in SwiftUI is aligning two texts with their baselines in different VStacks, when the content of these VStacks differs in height. Apple has a nice article on how to solve this problem ...
Mischa's user avatar
  • 17.5k
1 vote
1 answer
628 views

I'm struggling to achieve the following custom alignment in a SwiftUI VStack: I've created a custom alignment guide to use in the Event view, as follows: extension HorizontalAlignment { struct ...
AndrewC's user avatar
  • 461
1 vote
1 answer
148 views

I have two Rectangles, Rectangle A and Rectangle B. Rectangle A will move horizontally, and the center point of A will align with the top left corner of B in the horizontal direction. B will rotate ...
mars's user avatar
  • 497
1 vote
1 answer
183 views

Simply what I'm trying to achieve is this The Circle aligned to the bottom left edge of the other image I know that alignment guides should be used in this scenario, but I truly can't understand the ...
Mark George's user avatar
0 votes
1 answer
123 views

I'm trying to align the first line of texts with .firstTextBaseline however doesn't seem to work with LazyHStack. Similarly using AlignmentGuide also doesn't seem to be working. Am i missing something ...
Wy th's user avatar
  • 93
2 votes
1 answer
494 views

Here is a breakdown. I have a zstack that contains 2 vstacks. first vstack has a spacer and an image second has a text and button. ZStack { VStack { Spacer() Image("some image&...
Alessio's user avatar
  • 21
3 votes
2 answers
540 views

please see the image below for two examples of what is to be achived the alignment should be on the Center Y of the first lines of each UILabels and should work regardless of font size or font. ...
memical's user avatar
  • 2,561