草庐IT

UIViewController_keyboard

全部标签

ios - UITableView 向释放的 UIViewController 发送消息时崩溃

我一整天都在与以下堆栈跟踪作斗争。我无法重现该问题,但我知道它会发生在大量用户(Crashlytics)中。Crashed:com.apple.main-threadEXC_BAD_ACCESSKERN_INVALID_ADDRESSat0x0000000000000010Thread:Crashed:com.apple.main-thread0libobjc.A.dylib0x0000000194187bd0objc_msgSend+161UIKit0x000000018860639c-[UITableView_createPreparedCellForGlobalRow:withI

c# - 错误 CS1540/CS0122 : Getting keyboard size doesn't work after switching to Unified API

今天我更新到Xamarin.iOS8.6.0.51并切换到新的UnifiedAPI。现在我想获取键盘大小(此代码之前有效):varval=newNSValue(notification.UserInfo.ValueForKey(UIKeyboard.FrameBeginUserInfoKey).Handle);RectangleFkeyboardSize=val.RectangleFValue;在迁移工具的帮助下,RectangleF被转换为CGRect,但我得到的错误是ErrorCS1540:CannotaccessprotectedmemberFoundation.NSValue.

ios - UIViewController 在 XCode 7 中不再有成员 topViewController 或 viewControllers

更新到XCode7并将我的项目转换为最新的Swift2语法后,有一个错误我似乎无法修复。我有一个导航Controller的segue,需要将数据传递到其堆栈中的顶ViewController。到目前为止,以下一直有效:overridefuncprepareForSegue(segue:UIStoryboardSegue,sender:AnyObject?){letdestinationVC=segue.destinationViewController.viewControllers[0]as!MYViewController//ORletdestinationVC=segue.des

ios - UIViewController 内的 UIsearchController 使用自动布局

有没有人成功实现UIViewController包含一个UISearchControllersearchBar和一个UItableView在使用自动布局布置所有内容时?我正在尝试实现类似于1Password的东西在iPhone上做:一个固定的searchBar在tableView之上(不是其tableHeaderView的一部分)。当UISearchController拥有searchBar被激活,它的searchBar动画显示范围按钮,从而显示tableView向下移动一点。我已经掌握了这个布局的基础知识,可以在这个类中正常工作:////ViewController.m//UISea

ios - 如何使用自动布局约束调整嵌入式 UIViewController 的大小和位置?

这是我想做的:我的Storyboard包含一个只有几个控件的UIViewController。它的高度不到半个屏幕。为简单起见,我们将其称为DataViewController。DataViewController通过“ContainerView”嵌入到其他UIViewControllers中。虽然“ContainerView”显示了DataViewController,它仍然需要有一个显式的height设置。否则界面构建器会提示不明确的约束。现在,我如何告诉“ContainerView”它的大小应该是DataViewController所要求的大小?IE。没有在InterfaceBu

ios - UIViewController:extendedLayoutIncludesOpaqueBars 和 ScrollView 偏移

我的应用程序的View层次结构非常简单:一个UINavigationController包含一个UITableViewController。导航Controller的导航栏是不透明的,这会导致在导航转换期间表格View出现一些奇怪的插入行为,如下所示:为了解决这个问题,我将UITableViewController上的extendedLayoutIncludesOpaqueBars设置为true。这样做正确地扩展了导航栏下方的View,但以我不太理解的方式改变了TableView的contentOffset的行为。将此属性设置为true后,TableView的contentOffset

ios - 如何使用 NIB 文件推送 UIViewController

我是iOS开发的新手,我很头疼不理解一些可能很容易的事情。基本上,我使用UITableViewController转到另一个UITableViewController,但随后我需要从第二个UITableViewController转到UIViewController。我希望此UIViewController有一个.xib文件供我制作快速UI,但我似乎无法找到从第二个UITableViewController推送到此UIViewController的方法。我设法以编程方式显示标签,但不是来自.xib的UI。这是与程序化标签一起使用的代码:-(void)tableView:(UITable

iphone - UIViewController childViewControllers 数组上的 KVO

使用accessors似乎是在集合对象上获取KVO通知的方法,但这似乎不适用于UIViewController的childViewControllersNSArray属性。我想在向该属性添加或删除对象时收到通知。所以我尝试了这个:[selfaddObserver:selfforKeyPath:@"childViewControllers"options:NSKeyValueObservingOptionNewcontext:nil];-(NSUInteger)countOfChildViewControllers{returnself.childViewControllers.coun

iphone - 为什么 UIViewController 在屏幕上被释放

无法弄清楚发生了什么。我正在构建一个使用带分页的ScrollView的iPhone应用程序。ScrollView包含多个View,其ViewController通过调用从Storyboard中加载:[self.storyboardinstantiateViewControllerWithIdentifier:@"identifier"];我将ViewController添加到可变数组并将它们的View作为subview添加到ScrollView。出现在屏幕上后,ViewController被释放,因此目标操作不再起作用。当我启用ZombieObjects时,调试器在向Controlle

objective-c - 打开个人热点时 UIViewController 乱七八糟

当我打开个人热点连接时,我的布局被下推。我怎样才能删除顶部的这个热点栏或者得到这个栏的通知并根据它重新排列我的View?谢谢。 最佳答案 当状态栏的大小发生变化时,将调用您的应用程序委托(delegate)方法。您所要做的就是处理该选择器并手动更新您的View(如果您不想使用自动调整大小)。以下是您需要添加到您的应用委托(delegate)中的内容:-(void)application:(UIApplication*)applicationdidChangeStatusBarFrame(CGRect)oldStatusBarFram