iOS-UITextEffectsWindowの構造



Ios Uitexteffectswindow Anatomy



最近、他の友達がカスタマイズしたキーボードを変更したので、今日は3層ウィンドウでUITextEffectsWindowを分析します。 UITextEffectsWindowのレベルについて直接話さないでください。

最初のもの、キーボードのレンダリング:






2つ目は、下部のUITextEffectsWindowです。





3番目の画像、UITextEffectsWindowのUIInputWindowController:



4番目の画像、UIInputWindowControllerのUIInputSetContainerView:



5番目の図、UIInputSetContainerViewのUIInputSetHostView:



次に、問題はこれらのレベルを見つける方法ですか?いつものようにコードに直接進んでください。

#pragma mark Get the HostView of the keyboard window - (BOOL)haveTextEffectsWindowHostView{ UIWindow *keyboardWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1] UIView *keyboardContainerView UIView *keyboardHostView for(int i = 0 i <[keyboardWindow.subviews count] i++) { keyboardContainerView = [keyboardWindow.subviews objectAtIndex:i] UIViewController *nextResponder = (UIViewController*)[keyboardContainerView nextResponder] //Find the UIInputWindowController of the keyboardWindow layer if ([nextResponder isKindOfClass:NSClassFromString(@'UIInputWindowController')]) { for(int y = 0 y < [nextResponder.view.subviews count] y++) { //Look for UIInputSetContainerView of UIInputWindowController layer if([[keyboardContainerView description] hasPrefix:@'



見てくれてありがとう、そしてあなたが学んだことを適用してくれてありがとう!