Browse Source

Configure scrollEdgeAppearance with opaque background (#6038)

* Configure scrollEdgeAppearance with opaque background

I noticed there is now an animation that occurs when pushing the first
view on a stack. This will happen with both:

`largeTitle: { visible: true }`
and
`largeTitle: { visible: false }`

It seems caused by the setting of the `scrollEdgeAppearance` background
without first configuring it using `configureWithOpaqueBackground`.

I also added checks for iOS 13 since these APIs require iOS 13.

* Update lib/ios/TopBarAppearancePresenter.m

Co-Authored-By: Yogev Ben David <yogevbd@wix.com>

* Update lib/ios/TopBarAppearancePresenter.m

Co-authored-by: Yogev Ben David <yogev132@gmail.com>
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
Robert Paul 4 years ago
parent
commit
a2bdfacb27
No account linked to committer's email address
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      lib/ios/TopBarAppearancePresenter.m

+ 3
- 1
lib/ios/TopBarAppearancePresenter.m View File

36
         [self.getAppearance configureWithTransparentBackground];
36
         [self.getAppearance configureWithTransparentBackground];
37
         [self.getScrollEdgeAppearance configureWithTransparentBackground];
37
         [self.getScrollEdgeAppearance configureWithTransparentBackground];
38
     } else if (self.backgroundColor) {
38
     } else if (self.backgroundColor) {
39
+        [self.getAppearance configureWithOpaqueBackground];
40
+        [self.getScrollEdgeAppearance configureWithOpaqueBackground];
39
         [self.getAppearance setBackgroundColor:self.backgroundColor];
41
         [self.getAppearance setBackgroundColor:self.backgroundColor];
40
         [self.getScrollEdgeAppearance setBackgroundColor:self.backgroundColor];
42
         [self.getScrollEdgeAppearance setBackgroundColor:self.backgroundColor];
41
     } else if (self.translucent) {
43
     } else if (self.translucent) {
42
         [self.getAppearance configureWithDefaultBackground];
44
         [self.getAppearance configureWithDefaultBackground];
43
         [self.getScrollEdgeAppearance configureWithDefaultBackground];
45
         [self.getScrollEdgeAppearance configureWithDefaultBackground];
44
-    } else {
46
+    }  else {
45
         [self.getAppearance configureWithOpaqueBackground];
47
         [self.getAppearance configureWithOpaqueBackground];
46
         [self.getScrollEdgeAppearance configureWithOpaqueBackground];
48
         [self.getScrollEdgeAppearance configureWithOpaqueBackground];
47
     }
49
     }