I am trying to successfully align 2 UIButton
laying on TOP of a layerView
.
The hierarchy is as following:
The Buttons lay just on top of the layerView (Just a UIView which is black and has a certain alpha). Now I want the buttons to align within this "container".
Like this:
I was setting the constraints
to the left and top + to the right and top. also kept aspect ratio.
This was the result:
So it is just the buttons making problems. Anyone knows another way of solving this?
尝试将图层和按钮都放在父UIView
,然后让图层填充该视图,并使按钮在其中垂直居中。
UIView
UIView
to have fixed width and height UIView
to horizontally align to Center.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.