How to display activity indicator in center of UIAlertController?

后端 未结 13 1082
猫巷女王i
猫巷女王i 2020-12-08 05:18

I currently have a UIAlertController being displayed on the screen. The view of the alert should only display 2 elements, a title and a UIActivityIndicato

13条回答
  •  天命终不由人
    2020-12-08 05:38

    In swift:

    activityIndicator.center = self.view.center
    

    If you have a tool bar or a navController you might want to shift the point but otherwise, center is center...

    If you still have issues, perhaps this tutorial would help. If you are trying to center it in a table view controller, this answer might help.

提交回复
热议问题