question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

borderColor (top left bottom right) styling ignored on Android

See original GitHub issue

Environment

  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
      Memory: 36.54 MB / 8.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.5.0 - /usr/local/bin/node
      Yarn: 1.7.0 - /usr/local/bin/yarn
      npm: 6.1.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
      Android SDK:
        Build Tools: 23.0.1, 23.0.3, 25.0.1, 25.0.3, 26.0.1, 27.0.3
        API Levels: 23, 25, 26, 27
    IDEs:
      Android Studio: 3.1 AI-173.4720617
      Xcode: 9.4.1/9F2000 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1 
      react-native: 0.56.0-rc.4 => 0.56.0-rc.4 
    npmGlobalPackages:
      eslint-plugin-react-native: 1.2.0
      react-native-cli: 0.2.0
      react-native-git-upgrade: 0.2.7

Description

How my app should look, and did on 0.54.4: img_1941 (I know, I’m using iOS screenshot above. But my app looks identical so I’m using this for demo purposes. Pretend this is android)

How my app looks on android, on 0.56.0-rc.4: img_1940

The issue being my defined borderColors (top left bottom right) on each of the text boxes being ignored, and defaulting to black. Related to the number of changes to border styling I see on 0.56’s changelog, I assume.

Reproducible Demo

Relevant snippet from my styles.js. The text boxes being styled by summaryTouchable:

  summaryTouchable: {
    overflow: 'hidden',
    marginBottom: 10,
    borderTopColor: '#e5e6e9',
    borderLeftColor: '#dfe0e4',
    borderRightColor: '#dfe0e4',
    borderBottomColor: '#d0d1d5',
    borderWidth: 1,
    borderRadius: 3,
  },

My workaround on 0.56 for now is add this line only for Android to style summaryTouchable (no issue on iOS):

borderColor: Platform.OS === 'ios' ? null : '#dfe0e4',   // RN 0.56: workaround for Android ignoring 4 colors above

With this, Android on 0.56 would look similar to 0.54.4 screenshot above with light gray borders.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:46 (9 by maintainers)

github_iconTop GitHub Comments

21reactions
parkpoom2984commented, Jan 4, 2019

I solved like this style react native 0.57.1

    borderBottomLeftRadius: 10/2,
    borderBottomRightRadius: 10/2,
    borderTopLeftRadius: 10/2,
    borderTopRightRadius: 10/2,
    borderBottomWidth: 2,
    borderRightWidth: 2,
    borderTopWidth: 2,
    borderLeftWidth: 2,
    borderBottomColor: 'blue',
    borderRightColor: 'bule',
    borderTopColor: 'yellow',
    borderLeftColor: 'yellow'

@NicWickman

9reactions
raymochicommented, May 1, 2020

Hey guys, I ran into this issue too and noticed my borderRadius was too high. Make sure your borderRadius is exactly half your height and width for the best results.

Note that you need to use borderBottomWidth, borderTopWidth, borderLeftWidth, borderRightWidth instead of borderWidth

Cheers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS Property Border-Color Not Working - Stack Overflow
I had an issue where it seemed that border-color was not being respected, confusingly it even showed having the right color in the...
Read more >
border-color - CSS: Cascading Style Sheets - MDN Web Docs
When four values are specified, the colors apply to the top, right, bottom, and left in that order (clockwise). Values. <color>. Defines the ......
Read more >
How to Create and Style Borders in CSS - HubSpot Blog
If two values are defined, then the first value represents the top and bottom border widths and the second represents the right and...
Read more >
Quick and Easy Guide to the CSS Border Side Property | Udacity
It has also had a border color and style applied. A width was also set for ease of ... border-top: border-right: border-bottom: border-left:....
Read more >
CSS Support | Gmail - Google Developers
You can use standard CSS media queries to adjust the styling of an email to suit the ... margin-bottom; margin-left; margin-right; margin-top; marker-offset ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found