소스 검색

[RN] Workaround for Android view clipping

In another installment of "how on earth?!", using a 1px border instead of a
0.2px border fixes view clipping on a device where it didn't work before
(Moto X Play).

Observations:

- When nothing was rendered, rotating the device made the buttons show up, this
  makes me think the Surface is not properly composited with the toolbar view
  for some reason. Why this happens in some devices and not in others remains a
  mistery.

Other approaches attempted:

- Setting View.collapsed to false so it will remain in the view hierarchy. It
  made no effect.

- Setting View.needsOffscreenAlphaCompositing to true. It made no effect.

Just like before, I came up with this workaround by accident, but couldn't find
another way, so here we go again.
j8
Saúl Ibarra Corretgé 8 년 전
부모
커밋
2094b15432
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      react/features/base/styles/functions.js

+ 1
- 1
react/features/base/styles/functions.js 파일 보기

@@ -56,7 +56,7 @@ export function createStyleSheet(styles: StyleSheet, overrides: StyleSheet = {})
56 56
 export function fixAndroidViewClipping<T: StyleSheet>(styles: T): T {
57 57
     if (Platform.OS === 'android') {
58 58
         styles.borderColor = ColorPalette.appBackground;
59
-        styles.borderWidth = 0.2;
59
+        styles.borderWidth = 1;
60 60
     }
61 61
 
62 62
     return styles;

Loading…
취소
저장