ImageVerifierCode 换一换
格式:DOCX , 页数:6 ,大小:16.63KB ,
资源ID:20096471      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/20096471.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(UIWebView键盘的accessoryBar隐藏Word格式文档下载.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

UIWebView键盘的accessoryBar隐藏Word格式文档下载.docx

1、 self.removeAccessoryBarForiOS8(keyboardWindow as UIView) else self.removeAccessoryBarForiOS7(keyboardWindow as UIView) self.removeAccessoryBarForiOS9(UIApplication.sharedApplication().windows.last! as UIView) func removeAccessoryBarForiOS9(keyboardWindow:UIView) - for possibleFormView:UIView in key

2、boardWindow.subviews if possibleFormView.isMemberOfClass(NSClassFromString(UIInputSetContainerView)!) for subviewOfInputSetContainerView in possibleFormView.subviews if subviewOfInputSetContainerView.isMemberOfClass(NSClassFromString(UIInputSetHostView for subviewOfInputSetHostView in subviewOfInput

3、SetContainerView.subviews / 隐藏工具条NSClassFromString if subviewOfInputSetHostView.isMemberOfClass(NSClassFromString(UIWebFormAccessory subviewOfInputSetHostView.layer.opacity = 0 subviewOfInputSetHostView.frame = CGRectZero else if (subviewOfInputSetHostView.isMemberOfClass(NSClassFromString(_UIRemote

4、KeyboardPlaceholderView) / 这里使用了私有方法获取对应的accessorBar,然后进行隐藏 var accessory = subviewOfInputSetHostView.performSelector(Selector(placeheldView).takeRetainedValue() if accessory.isMemberOfClass(NSClassFromString( let accessory = accessory as! UIView accessory.layer.opacity = 0 accessory.frame = CGRectZ

5、ero / 键盘背景, UIKBInputBackdropView有两个只隐藏上面的 else if subviewOfInputSetHostView.isMemberOfClass(NSClassFromString(UIKBInputBackdropView) & subviewOfInputSetHostView.frame.size.height 100 subviewOfInputSetHostView.userInteractionEnabled = false func removeAccessoryBarForiOS8(keyboardWindow: / 隐藏工具条 func

6、 removeAccessoryBarForiOS7(keyboardWindow:UIPeripheralHostView for subviewOfPeripheralHostView in possibleFormView.subviews if subviewOfPeripheralHostView.isMemberOfClass(NSClassFromString( subviewOfPeripheralHostView.layer.opacity = 0 subviewOfPeripheralHostView.frame = CGRectZero else if subviewOf

7、PeripheralHostView.isMemberOfClass(NSClassFromString( subviewOfPeripheralHostView.frame.size.height subviewOfPeripheralHostView.userInteractionEnabled = false实际中,隐藏键盘accessory后的样子如下图:webview_keyboard_hideaccessory.png需要注意的是,在示例代码使用设置layer透明,frame为空来进行隐藏,而不使用removeFromSuperView,是因为使用了removeFromSuperV

8、iew,在键盘重新布局时会导致crash。当然如果有朋友解决了crash,使用removeFromSuperView会更好。附:上面示例代码Github地址使用removeFromSuperView产生crash的崩溃栈:2016-07-06 14:10:32.018 WebViewKeyBoard10846:930540 The view hierarchy is not prepared for the constraint: When added to a view, the constraints items must be descendants of that view (or t

9、he view itself). This will crash if the constraint needs to be resolved before the view hierarchy is assembled. Break on -UIView(UIConstraintBasedLayout) _viewHierarchyUnpreparedForConstraint: to debug.930540 * Assertion failure in -UIInputSetHostView _layoutEngine_didAddLayoutConstraint:roundingAdj

10、ustment:mutuallyExclusiveConstraints:, /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/NSLayoutConstraint_UIKitAdditions.m:59032.025 WebViewKeyBoard10846:930540 * Terminating app due to uncaught exception NSInternalInconsistencyException, reason: Impossible to set up layout

11、 with view hierarchy unprepared for constraint.* First throw call stack:( 0 CoreFoundation 0x0000000105517d85 _exceptionPreprocess + 165 1 libobjc.A.dylib 0x00000001072bbdeb objc_exception_throw + 48 2 CoreFoundation 0x0000000105517bea +NSException raise:format:arguments: + 106 3 Foundation 0x000000

12、0105968d5a -NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description: + 198 4 UIKit 0x0000000106626b99 _120-UIView(UIConstraintBasedLayout) _layoutEngine_didAddLayoutConstraint:_block_invoke_2 + 254 5 UIKit 0x000000010662698b -UIView(UIConstraintBasedLayout) _layoutEngine_didAddLa

13、youtConstraint: + 385 6 UIKit 0x0000000106626e04 -UIView(UIConstraintBasedLayout) _tryToAddConstraintWithoutUpdatingConstraintsArray: + 65 7 UIKit 0x0000000106626f7d -UIView(UIConstraintBasedLayout) _tryToAddConstraint: + 288 8 UIKit 0x000000010662719f -UIView(UIConstraintBasedLayout) _addConstraint

14、: + 274 9 UIKit 0x0000000106627438 _50-UIView(UIConstraintBasedLayout) addConstraints:_block_invoke + 197 10 Foundation 0x00000001058f23d3 -NSISEngine withBehaviors:performModifications: + 155 11 UIKit 0x0000000106626577 -UIView(UIConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled: + 58

15、 12 UIKit 0x0000000106627348 -UIView(UIConstraintBasedLayout) addConstraints: + 379 13 UIKit 0x00000001066b5531 -UIInputWindowController updateViewConstraints + 3558 14 UIKit 0x00000001066b1fde -UIInputSetHostView _didChangeKeyplaneWithContext: + 224 15 UIKit 0x000000010650f1cc -_UIKBCompatInputView

16、 _didChangeKeyplaneWithContext: + 87 16 UIKit 0x0000000106004397 -UIKeyboard _didChangeKeyplaneWithContext: + 324 17 UIKit 0x0000000105fe7b04 -UIKeyboardImpl _didChangeKeyplaneWithContext: + 1100 18 UIKit 0x000000010620d5a3 -UIKeyboardLayoutStar(UIKeyboardLayoutJapanese50OnFlick) _didChangeKeyplaneW

17、ithContext: + 183 19 UIKit 0x00000001061f121e -UIKeyboardLayoutStar setKeyplaneName: + 4512 20 UIKit 0x0000000106209c37 -UIKeyboardLayoutStar setShift: + 158 21 UIKit 0x0000000105fec46a -UIKeyboardImpl notifyShiftState + 73 22 CoreFoundation 0x000000010543cc37 _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVE

18、R_CALLBACK_FUNCTION_ + 23 23 CoreFoundation 0x000000010543cba7 _CFRunLoopDoObservers + 391 24 CoreFoundation 0x00000001054326c4 _CFRunLoopRun + 836 25 CoreFoundation 0x00000001054320f8 CFRunLoopRunSpecific + 488 26 GraphicsServices 0x0000000109badad2 GSEventRunModal + 161 27 UIKit 0x0000000105d3ff09 UIApplicationMain + 171 28 WebViewKeyBoard 0x000000010532a242 main + 114 29 libdyld.dylib 0x0000000107d7f92d start + 1 30 ? 0x0000000000000001 0x0 + 1)libc+abi.dylib: terminating with uncaught exception of type NSException

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1