0

I would like to overlap two views (one view on top of each other) inside uistackview . My objective is to display initials of username on top of his image. The image size is constant and the initial label should be in centre of image view

I have a uitableviewcell on which other labels and buttons are also organized

here is the view hierarchy.

View Hierarchy

ahmed
  • 540
  • 2
  • 18

2 Answers2

0

I tried to fix this in following way and it works

Excluded the view which I wanted to overlap from UIStackView

Make that Label to align with following constraints

Center Vertically with ImageView Center Horizontally with ImageView Equal Widhts with ImageView Equal Heights with ImageView

Constraints of Label to UIImageView

Arrangement of StackView

ahmed
  • 540
  • 2
  • 18
0

To overlap views use -ve spacing in StackView