I have a UIViewController
presented using self.accountViewController.modalPresentationStyle = UIModalPresentationFormSheet;
and now in iOS 8 the last UITextView
is hidden from the keyboard when it will pushed up. How to avoid It?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
@Oleg's solution is good but it doesn't take into consideration keyboard changes in size while its already showing.. also, he hardcoded the animation duration and a few other parameters. See my solution below:
Add an observer of
UIKeyboardWillChangeFrameNotification
to theviewDidLoad
And then add the method:
Don't forget to remove the keyboard observer in both viewDidUnload and in Dealloc.
For solving of you're problem you should change
frame
orconstrain
of thetextview
.Small tip for you:
Use Notification to detect when keyboard will show or hide.
Sample of notification:
And than change the one of the parameters that are mention above.
Example of changing of frame:
Swift Version of @newton_guima's answer above incase anyone wants it.
Add observer of
UIKeyboardWillChangeFrameNotification
toviewDidLoad()
:Then add this method:
Then remove the observer wherever you transition away from the view or in
deinit
: