IOS嵌入式单手键盘
我已经在谷歌上搜索过了,但是我找不到任何与此相关的东西。我想使用iOS 8应用程序扩展实现iPhone 6和6+的单手键盘。我知道如何实现自定义键盘的一次性使用,但想知道如何实现它的右侧和左侧IOS嵌入式单手键盘,ios,keyboard,Ios,Keyboard,我已经在谷歌上搜索过了,但是我找不到任何与此相关的东西。我想使用iOS 8应用程序扩展实现iPhone 6和6+的单手键盘。我知道如何实现自定义键盘的一次性使用,但想知道如何实现它的右侧和左侧 您可以在self.view上设置ui视图,并在其上设置所有键(按钮),而不是直接在self.view上添加,并根据此视图添加所有布局约束。通过执行此操作,可以增加/减少“关键点”容器视图的x原点 例如,你可以这样做: 左对齐 CGRect rect = keysContainerView.frame;
您可以在
self.view
上设置ui视图,并在其上设置所有键(按钮),而不是直接在self.view
上添加,并根据此视图添加所有布局约束。通过执行此操作,可以增加/减少“关键点”容器视图的x原点
例如,你可以这样做:
左对齐
CGRect rect = keysContainerView.frame;
rect.origin.x = 0.0;
keysContainerView.frame = rect;
CGRect rect = keysContainerView.frame;
rect.origin.x = CGRectGetWidth(self.view.frame) - CGRectGetWidth(keysContainerView.frame);
keysContainerView.frame = rect;
右对齐
CGRect rect = keysContainerView.frame;
rect.origin.x = 0.0;
keysContainerView.frame = rect;
CGRect rect = keysContainerView.frame;
rect.origin.x = CGRectGetWidth(self.view.frame) - CGRectGetWidth(keysContainerView.frame);
keysContainerView.frame = rect;