ZSSRichTextEditor
ZSSRichTextEditor copied to clipboard
How to hide second toolbar below rich text toolbar? [Xcode 11]
Manually added the source files. How to hide the second toolbar?
@interface Test
@property (nonatomic, strong) UIWindow *textEffectsWindow;
@end
@implementation Test
- (UIWindow *)textEffectsWindow {
__block UIWindow *keyboardWindow = nil;
[UIApplication.sharedApplication.windows enumerateObjectsUsingBlock:^(__kindof UIWindow * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj.class isEqual:NSClassFromString(@"UITextEffectsWindow").class]) {
keyboardWindow = obj;
*stop = YES;
}
}];
return keyboardWindow;
}
- (void)hideTextEffectsWindow {
self.textEffectsWindow.layer.opacity = 0;
}
- (void)keyboardWillShowOrHide:(NSNotification *)notification {
if (keyboardEnd.origin.y < [[UIScreen mainScreen] bounds].size.height) {
[self hideTextEffectsWindow];
} else {
}
}
@end
@oangkin : Where to write this code?
Is UITextEffectsWindow a private class? If it is, wouldn't this solution be a potential problem during submission to the App Store?
Seems to work in the editor view. Call [self hideTextEffectsWindow];
in - (void)keyboardWillShowOrHide:(NSNotification *)notification {
just below if (keyboardRect.origin.y < screeenHeight) {
.
@oangkin : Where to write this code?
我更新了回复,在键盘出现的时候调用即可
Is UITextEffectsWindow a private class? If it is, wouldn't this solution be a potential problem during submission to the App Store?
这个是私有类,我的app审核通过了,如果要实现这个功能目前没别的办法。
Seems to work in the editor view. Call
[self hideTextEffectsWindow];
in- (void)keyboardWillShowOrHide:(NSNotification *)notification {
just belowif (keyboardRect.origin.y < screeenHeight) {
.
你说的是对的
这个是私有类,我的app审核通过了,如果要实现这个功能目前没别的办法。
@oangkin Ok, but if I understand the way Apple reviews work, there is a chance that they will find private calls in any submission to the store. (including updates) So unfortunately this is not a useable solution for my team even if it is the only way. (Congrats on making it through 👍)