React-native: Applying borderRadius to <Text> ignores backgroundColor

Created on 8 Nov 2016  路  10Comments  路  Source: facebook/react-native

Description

Applying a borderRadius to a element with a border and a backgroundColor only affects the actual border. The backgroundColor stays square. If this is intended behaviour the documentation has to be changed cause it says style applies to aswell Text Style but this behaviour does not appear to a element.

example
<Text style={{ backgroundColor: '#f008', borderWidth: 1, borderColor: '#000', borderRadius: 12, padding: 8 }}>Test text</Text>

produces
image

according to my expectations, backgroundColor should be rounded corners aswell?

Reproduction

Try this snippet to reproduce.
<Text style={{ backgroundColor: '#f008', borderWidth: 1, borderColor: '#000', borderRadius: 12, padding: 8 }}>Test text</Text>

Additional Information

  • React Native version: 0.36
  • Platform: iOS, don't know about Android
  • Operating System: MacOS
Locked

Most helpful comment

Try overflow="hidden", it should help.

All 10 comments

Try overflow="hidden", it should help.

@facebook-github-bot answered

Works on iOS not on Android.
Android has a issue on it here: https://github.com/facebook/react-native/issues/3198

as @christopherdro said: answered
this can be closed @albinhubsch @hramos 馃槈

@stoffern why this issue is closed if it is not fixed? It should work without hacks with overflow, same as for usual View. Should be reopened and fixed.

@hramos why this is closed? still a bug

See above:

screen shot 2018-03-14 at 2 51 09 pm

Please open a new issue if this affects you.

I do not understand the logic behind this, a workaround not means a solved bug.

/cc @hramos

As i Wrote:

Works on iOS not on Android.
Android has a issue on it here: #3198

as @christopherdro said: answered
this can be closed @albinhubsch @hramos 馃槈

Please refer to the original issue #3198

wat

Please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings