[英]NSLayoutConstraints code to center a view and maintain its aspect ratio
[英]Center 4 Images and maintain aspect ratio
將圖像視圖(1,2,3,4)放在UIView(例如ContentView)中,並給它兩個約束-容器頂部空間和容器水平居中位置。 我以為您設置imageViews的方式(對容器約束具有高度,底部和頂部空間),它們將提供ContentView的高度。
這將幫助您將包含所有四個圖像的ContentView居中。
希望能有所幫助。 讓我知道這是否適合您。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.