react / react/react-native

View will lost background color when set borderRadius and height is large enough on Android device

未关闭
#15,826 62 条评论 42 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Bug Help Wanted :octocat: Platform: Android Priority: Low
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

No

Environment

@mjmasn's environment:

Environment:
  OS: Linux 4.13
  Node: 8.11.0
  Yarn: 1.7.0
  npm: 5.6.0
  Watchman: 4.9.0
  Xcode: N/A
  Android Studio: 3.1 AI-173.4670197

Packages: (wanted => installed)
  react: ^16.4.1 => 16.4.1
  react-native: ^0.55.4 => 0.55.4

@beiming's environment:

Environment:
  OS: macOS
  Node: 7.7.1
  npm: 4.1.2

Packages: (wanted => installed)
  react-native: ^0.47.2 => 0.47.2

Target Platform: 
  Android
  Android version: 4.4.4
  Screen resolution: 720 x 1280
Steps to Reproduce
// index.android.js

import React, {Component} from 'react';
import {AppRegistry, View, Text, ScrollView} from 'react-native';

class App extends Component {
    render() {
        return (
            <ScrollView>
                <View style={{
                    // if `borderRadius` > 0 and `height` is large enough like 3000 (2000 is ok on my android device), `backgroundColor` will disappear.
                    borderRadius: 1,
                    height: 3000,
                    backgroundColor: 'red',
                    alignItems: 'center',
                    justifyContent: 'center'
                }}>
                    <Text>Test</Text>
                </View>
            </ScrollView>

        );
    }
}

AppRegistry.registerComponent('App', () => App);

Run react-native run-android on a device, it does not reproduce on an AVD.

Expected Behavior

It will be show a long view, with red background, and scroll view show Test in center.

Actual Behavior

It will be show a long view, but no background color (white, maybe transparent), and scroll view show Test in center.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 index.android.js 的复现开始,并在实体 Android 设备上运行 react-native run-android,因为该问题无法在 AVD 上复现。跟踪 Android View 针对较大 height、borderRadius 和 backgroundColor 的渲染路径。当红色背景在受影响的设备上滚动时仍保持可见,并且现有复现按预期运行时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
android, javascript, react-native
领域
mobile
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。