Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

圆角边框问题 #1538

Open
devYoungyang opened this issue Sep 9, 2019 · 13 comments
Open

圆角边框问题 #1538

devYoungyang opened this issue Sep 9, 2019 · 13 comments
Assignees
Labels
UI控件 UI组件出现样式、效果、逻辑等问题 功能优化 有关性能等相关问题

Comments

@devYoungyang
Copy link

是否为新品(必填)
新品

用户ID(必填)
1434926611

企业名称(必填)
飞彗

环境(必填)

  • 电脑操作系统:[eg.Windows/Mac OS/Linux]
  • 手机系统:[eg.Android 8.1/iOS 11.0]
  • SDK分支: [eg.master/10000/...]
  • 相关模块:[eg.Host/Service/Account]

现象(必填)
<View style={{ height: 400, alignItems: "center", justifyContent: 'center' }}> <View style={{ width: 200, height: 200, borderColor: 'cyan', backgroundColor: 'red', borderRadius: 10, borderWidth: 2.5 }} /> </View>
如上给一个组件设置圆角边框,在圆角周围会有一条黑色的线

期望(必填)
给出原因,解决上述问题,

不要贴大段代码❗️

@MIoTBot
Copy link

MIoTBot commented Sep 9, 2019

@devYoungyang 感谢您提出宝贵的 issue,我会通知开发尽快处理!

@zanetti4 zanetti4 added JS使用问题 用于统计,主要包括第三方对js使用有误等问题 功能优化 有关性能等相关问题 labels Sep 9, 2019
@zanetti4
Copy link
Contributor

zanetti4 commented Sep 9, 2019

您说的是这个问题吗? #1390

@devYoungyang
Copy link
Author

不是,你把我的代码放在一个demo执行一下,仔细看圆角周围会有细线

@zanetti4
Copy link
Contributor

zanetti4 commented Sep 9, 2019

我在安卓手机测试,没看出来有黑色的线……你能贴个截图吗?这个问题在安卓、ios 都有吗?

@devYoungyang
Copy link
Author

安卓没有,iOS设备才有

@devYoungyang
Copy link
Author

情景再现了没有?

@zanetti4
Copy link
Contributor

复现了,正在查找原因

@ningRegister
Copy link

@devYoungyang
显示器的颜色是某几个颜色合成的,正好这两个颜色发生了物理反应,您可以在用其他颜色试一下,应该没有问题

@devYoungyang
Copy link
Author

其他颜色是没有问题,原因能说清楚一点吗?

@devYoungyang
Copy link
Author

@zanetti4 这个问题给出这个解释,就算解决了?

@ningRegister ningRegister reopened this Sep 19, 2019
@zanetti4
Copy link
Contributor

我们查到更详细的解释,再告诉您。

@zanetti4 zanetti4 added UI控件 UI组件出现样式、效果、逻辑等问题 and removed JS使用问题 用于统计,主要包括第三方对js使用有误等问题 labels Sep 19, 2019
@devYoungyang
Copy link
Author

大半个月过去了,没有回音吗

@chengww5217
Copy link
Collaborator

似乎这个问题是 RN 自己在 IOS 上面的问题。

我在 https://reactnative.dev/docs/getting-started 上面用示例代码一样复现了这个问题。

这边有一个临时的解决办法是在外层套上一层 View,在外层进行 border 的设定以避免此问题:

<View style={{
  borderColor: 'cyan',
  borderRadius: 10,
  borderWidth: 4,
  overflow: 'hidden',
  marginTop: 16,
  }}>
      <View style={{
          width: 200,
          height: 200,
          backgroundColor: 'red',
      }}/>
</View>

** PS:如果有大量的此布局可能会导致性能问题。 **

附上运行在 https://reactnative.dev/docs/getting-started 的示例代码:

            <View style={{
                alignItems: "center",
                justifyContent: 'center',
                backgroundColor: 'white',
                flex: 1,
            }}>
                <View style={{
                    width: 200,
                    height: 200,
                    borderColor: 'cyan',
                    backgroundColor: 'red',
                    borderRadius: 10,
                    borderWidth: 4,
                }}/>

                <View style={{
                    borderColor: 'cyan',
                    borderRadius: 10,
                    borderWidth: 4,
                    overflow: 'hidden',
                    marginTop: 16,
                }}>
                    <View style={{
                        width: 200,
                        height: 200,
                        backgroundColor: 'red',
                    }}/>
                </View>

            </View>

在原生 Expo Go IOS 客户端运行的截图:

IMG_20D2BED6F7E3-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
UI控件 UI组件出现样式、效果、逻辑等问题 功能优化 有关性能等相关问题
Projects
None yet
Development

No branches or pull requests

5 participants