问题描述
我从这里有一个Viewcontroller,我得到了一个弹出窗口.从这个弹出窗口中,我呈现了一个视图作为模态视图.其中有一个textview.当开始编辑时,整个模式视图将向上移动(通常人们希望这样做).但是我不希望那样.有什么办法可以阻止模态视图在键盘上显示和隐藏时上下移动?
I have a viewcontroller from here I am getting a popover. From this popover i am presenting a view as modal view.There is a textview in it. When editing begins, the entire modal view moves up (which usually people desire). But I do not want it that way.Is there any way, i can block my modal view from moving up and down on keyboard show and hide ?
推荐答案
如果我猜对了,那么您需要设置 yourviewControler.modalPresentationStyle = UIModalPresentationPageSheet;
If I guessed correctly then you need to set yourviewControler.modalPresentationStyle=UIModalPresentationPageSheet;
代替您现在可能正在使用的 yourviewControler.modalPresentationStyle = UIModalPresentationFormSheet;
instead of what you are probably using right now yourviewControler.modalPresentationStyle=UIModalPresentationFormSheet;
这篇关于不想让模态视图在键盘显示上上移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!