How to put an image on UIActionSheet?

坚强是说给别人听的谎言 提交于 2019-12-20 07:54:58

问题


How to put image on UIActionSheet on right position of text. Like given in apple music player.

Note: Don't answer with custom view, if it is possible in UIActionSheet, Kindly let us know.


回答1:


Don't answer with custom view

Then you are effectively forbidding anyone to answer, because that is what you do.

First of all, there is no such thing as UIActionSheet. It was deprecated four years ago. Today we use UIAlertController.

UIAlertController is nothing but a prepackaged presented view controller. It does nothing that you could not do for yourself. It is also deliberately very simple and limited. So if you want to do something that goes beyond the limits what UIAlertController gives you, then you simply create a custom presented view controller. Adding the animation and "dimming view" to make it look like a standard action sheet is easy; just make a custom transition animation.

That is what the interface shown in your screen shot is. It is not a UIActionSheet. It is not a UIAlertController. It's just a custom presented view controller that Apple has created. And so can you.



来源:https://stackoverflow.com/questions/51481984/how-to-put-an-image-on-uiactionsheet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!