Pārlūkot izejas kodu

About view: fix white flash prominently shown on older devices

Felix Paul Kühne 12 gadi atpakaļ
vecāks
revīzija
1d0679ed59

+ 12 - 2
AspenProject/VLCAboutViewController.m

@@ -23,7 +23,6 @@
 {
     [super viewDidLoad];
 
-    self.webView.hidden = YES;
     [self.webView loadHTMLString:[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"About Contents" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil] baseURL:nil];
     self.webView.delegate = self;
     self.aspenVersion.text = [[NSString stringWithFormat:NSLocalizedString(@"VERSION_FORMAT",@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]] stringByAppendingFormat:@" %@", kVLCVersionCodename];
@@ -51,7 +50,18 @@
 
 - (void)webViewDidFinishLoad:(UIWebView *)webView
 {
-    self.webView.hidden = NO;
+    webView.alpha = 0.;
+    CGFloat alpha = 1.;
+
+    void (^animationBlock)() = ^() {
+        webView.alpha = alpha;
+    };
+
+    void (^completionBlock)(BOOL finished) = ^(BOOL finished) {
+        webView.hidden = NO;
+    };
+
+    [UIView animateWithDuration:1. animations:animationBlock completion:completionBlock];
 }
 
 - (void)dismiss

+ 1 - 2
Resources/VLCAboutViewController~ipad.xib

@@ -160,11 +160,10 @@ IEvDvGhuZSwgR2xlYiBQaW5pZ2luLCBhbmQgSmVhbi1CYXB0aXN0ZSBLZW1wZg</string>
 					</object>
 					<object class="IBUIWebView" id="804382523">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">274</int>
+						<int key="NSvFlags">-2147483374</int>
 						<string key="NSFrame">{{84, 220}, {600, 747}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<reference key="NSWindow"/>
-						<reference key="NSNextKeyView"/>
 						<string key="NSReuseIdentifierKey">_NS:9</string>
 						<object class="NSColor" key="IBUIBackgroundColor" id="115530952">
 							<int key="NSColorSpace">3</int>

+ 1 - 2
Resources/VLCAboutViewController~iphone.xib

@@ -165,11 +165,10 @@ IEvDvGhuZSwgR2xlYiBQaW5pZ2luLCBhbmQgSmVhbi1CYXB0aXN0ZSBLZW1wZg</string>
 					</object>
 					<object class="IBUIWebView" id="384092769">
 						<reference key="NSNextResponder" ref="191373211"/>
-						<int key="NSvFlags">274</int>
+						<int key="NSvFlags">-2147483374</int>
 						<string key="NSFrame">{{0, 208}, {320, 340}}</string>
 						<reference key="NSSuperview" ref="191373211"/>
 						<reference key="NSWindow"/>
-						<reference key="NSNextKeyView"/>
 						<string key="NSReuseIdentifierKey">_NS:9</string>
 						<object class="NSColor" key="IBUIBackgroundColor">
 							<int key="NSColorSpace">3</int>