How To Present Half Screen Modal View?

独自空忆成欢 提交于 2019-12-05 10:13:27

Here is what u need its an open source code on github TDSemiModalView having a half view date picker. Check the demo project inside the code. Here is the link.. Hope it solves your problem.

TDSemiModalClass

@Jon:

METHOD-1:

Make your main view transperant by setting its alpha value to 0 and add a subview to the main view which is only half of the main screen and keep it opaque (alpha value as 1) as it would be by default.

Then simply present the view controller using present Modal View Controller.

Keep in mind that because of the transperancy you would be able to see half of the previous view, but wont be able to touch it as there is a transperant view.

METHOD-2:

Another work around is to animate a UIView which is of size half of the existing view.

Then you have to simply follow animation of the UIView.

Here as it is just a UIView that will be added as subview to existing view, you will be able to touch the rest of the screen.

So you can follow either of the methods as per your requirement.

Hope this helps you.

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