View on Top of UITabBar

后端 未结 7 1779
慢半拍i
慢半拍i 2021-02-02 16:03

Similar to what the Spotify or Apple Music app does when a song is playing, it places a custom view on top of the UITabBar:

Solutions I\'ve tried:

  1. UITa

7条回答
  •  深忆病人
    2021-02-02 16:46

    Besides playing with UITabBar or container vc, you could also consider adding the view in the App Delegate to the main window like in following post:

    View floating above all ViewControllers

    Since your view is all around along with the Tab bar, it is totally ok to make it in the App Delegate.

    You can always access the Floating view from App Delegate Singleton by making it a property of the App Delegate. It is easy then to control its visibility in anywhere of your code.

    Changing constant of the Constraints between the Floating view and super view window can adjust the position of the view, thus handsomely respond to orientation changes.

    Another(similar) approach is to make the floating view another window like the uid button.

提交回复
热议问题