我遇到了一个奇怪的问题,当 View 的类设置为 TPKeyboardAvoidingScrollView 时,模拟器或我的 iPhone 上的按钮不会显示。
截图如下:
当 View 的类设置为 UIView(默认)时,它可以正常工作。
最佳答案
参见this post获取说明。
For non-UITableViewControllers, use it as-is by dropping the TPKeyboardAvoidingScrollView source files into your project, popping a UIScrollView into your view controller’s xib, setting the class to TPKeyboardAvoidingScrollView, and putting all your controls within that scroll view.
To use it with UITableViewController, pop the TPKeyboardAvoidingTableView source files in, and just make your UITableView a TPKeyboardAvoidingTableView in the xib — everything should be taken care of.
您使用它时是否带有UITableViewController
?确保您已将该按钮嵌入到 UIScrollView
中。上面链接的网站还有一个示例项目,您可以引用以获取更多帮助。
关于iphone - 当 View 的类为 TPKeyboardAvoidingScrollView 时,UIButton 不会在模拟器上显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16630333/