Add UIActivityIndicatorView into UIBarButton

后端 未结 6 1649
忘了有多久
忘了有多久 2021-02-01 03:00

How do I add a UIActivityIndicatorView spinner circle into a UIBarButton, so that when a user taps on one of those buttons on the navigation bar, they see a spinner while the lo

6条回答
  •  青春惊慌失措
    2021-02-01 03:52

    UIActivityIndicatorView is a type of view. Set its frame to be within your button and use -addSubview to add it to the view hierarchy of the UIBarButton.

    I'm oversimplifying, since you have to try to make it fit the space (possibly by scaling) and center it...

提交回复
热议问题