2019-03-19 iOS WKWebview 的 scrol

2019-03-19  本文已影响0人  Cocoa_Coder

如题,在这个WkWebview的代理中:

-(void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation;

执行 [webview.scrollView setContentOffset:animated:] 方法,会出现不工作的问题,解决方法是延时执行这一方法

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            
            [self.webView.scrollView setContentOffset:animated:];

        });

关于日历->选择佛历以及日本日历的处理方法:

非公历日期,添加本地化

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];

if (![[NSCalendar autoupdatingCurrentCalendar].calendarIdentifier isEqualToString:NSCalendarIdentifierGregorian]) {//非公历日期,添加本地化
        NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:[[NSLocale preferredLanguages] objectAtIndex:0]];
        [formatter setLocale:locale];
    }

上一篇 下一篇

猜你喜欢

热点阅读