IOS learning-tableview's cell keyboard with editing function pops up to block and collapse the problem. tableviewcell

Source: Internet
Author: User

IOS learning-tableview's cell keyboard with editing function pops up to block and collapse the problem. tableviewcell

Recently, it is often used in projects that the cell in UITableView contains UITextField or UITextView. In this scenario, when we click the cell below the screen to edit, at this time, when the keyboard pops up, the cell to be input will be blocked. As a result, we cannot conveniently view the input content. This is a very bad experience. This problem was explained at our discretion.IOS learning-solution to the problem that the keyboard pops up to block the input boxThe corresponding solution has also been mentioned, but this solution has some minor issues in recent applications. We will try again here.

A primary controller is UITableViewController or its subclass.

First, there is a very simple solution, that isReplace Our controller with UITableViewController or its subclass.The cell in UITableViewController automatically moves up when a keyboard pops up. The area to be edited can be located above the keyboard, in this way, we can also see the edited content, so that we can modify and adjust the specific content.

However, if our overall layout is not only a UITableView, or we need to use the MBProgressHUD framework in the project, we may not be able to directly set our controller to UITableViewController or its subclass, because the MBProgressHUD framework shows bugs in UITableViewController and UICollectionViewControllerMBProgressHUD framework official documentationTo avoid adding the HUD to some UIKit views with complex view hierarchies (such as UITableView or UICollectionView), UITableViewController, and self in UICollectionViewController. view is actually the corresponding UITableView or UICollectionView, so there will be some inexplicable bugs that cannot be displayed or the display location is incorrect.

Original article: You can add the HUD on any view or window. It is however a good idea to avoid adding the HUD to certain UIKit views with complex view hierarchies-likeUITableViewOrUICollectionView. Those can mutate their subviews in unexpected ways and thereby break HUD display.
You can add a HUD in any view or window. However, it is a good idea to avoid adding a HUD to some UIKit views with complex view hierarchies (such as UITableView or UICollectionView. This may change their subviews in unexpected ways, thus damaging the HUD display.

The second master controller is UIViewController or its subclass.

In fact, I used UITableViewController at the very beginning. The tips to be prompted is always displayed in an unspecified position, and I was helpless when I discovered this bug.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.