瀏覽代碼

[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…
取消
儲存