How to center a subview of UIView

前端 未结 14 1930
無奈伤痛
無奈伤痛 2020-11-30 16:47

I have a UIView inside a UIViewm and I want the inner UIView to be always centered inside the outer one, without it having to resize t

14条回答
  •  一向
    一向 (楼主)
    2020-11-30 17:19

    In c# or Xamarin.ios, we can use like this

    imageView.Center = new CGPoint(tempView.Frame.Size.Width / 2, tempView.Frame.Size.Height / 2);

提交回复
热议问题