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

真机运行,背景颜色不能正确显示。 #7

Open
manyuanrong opened this issue Aug 15, 2018 · 3 comments
Open

真机运行,背景颜色不能正确显示。 #7

manyuanrong opened this issue Aug 15, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@manyuanrong
Copy link
Contributor

在模拟器上不会有任何问题(如下,左侧效果,右侧代码):
image

真机:
image

真机型号:
小米 Mix2
OS:MIUI 10 8.8.14 开发版

@manyuanrong
Copy link
Contributor Author

有趣的是,如果圆角大于0.3就能正确填充背景。但实际并不需要圆角效果。
发现此问题的过程:
1.真机调试,发现部分效果无效,显示空白。
2.Demo中的Label示例能正常显示。
3.复制Lablel中的属性到不能正常显示的元素中。能显示。
4.修改部分属性,直到能显示。发现圆角大于0.3才能填充背景。

@akira-cn
Copy link
Contributor

borderRadius的单位不是小数,应该是整数,上面的例子你要用borderRadius: 20

至于borderRadius < 0.3 在android的一些机器为啥显示不出来背景,我还得查一下(我怀疑和浮点数运算有关)。。。
iOS下是没问题的

@akira-cn akira-cn added the bug Something isn't working label Aug 20, 2018
@manyuanrong
Copy link
Contributor Author

我本来是不需要borderRadius的,但设置为0,背景也不会渲染,为了能够渲染,我不得不把borderRadius设置为0.3以使边框效果尽量看不出来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants