Skip to content

borderStyle has no effect on Android, border is always solid #18285

Closed

Description

@patricksmith

Setting borderStyle has no effect on Android. Regardless of the setting, the border will always be solid.

Environment

Environment:
  OS: macOS Sierra 10.12.6
  Node: 7.10.1
  Yarn: 1.2.1
  npm: 4.2.0
  Watchman: 4.5.0
  Xcode: Xcode 9.2 Build version 9C40b
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  react: 16.2.0 => 16.2.0
  react-native: 0.54.0 => 0.54.0

Expected Behavior

When setting the borderStyle to "dashed" or "dotted", I expect the view to have a dashed or dotted border. This works correctly on iOS:

image

Actual Behavior

Regardless of setting, the border is solid on Android:

image

Steps to Reproduce

Create a View with styles specifying a borderWidth, borderColor, and borderStyle (borderRadius was also set, since there seem to be existing issues with the border when borderRadius is not specified).

This component will reproduce the issue:

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default class App extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <Text>Open up App.js to start working on your app!</Text>
        <Text>Changes you make will automatically reload.</Text>
        <Text>Shake your phone to open the developer menu.</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
    marginVertical: 200,
    marginHorizontal: 20,
    borderColor: '#000',
    borderRadius: 5,
    borderWidth: 5,
    borderStyle: 'dashed'
  },
});

An Expo Snack is also available that reproduces the issue: https://snack.expo.io/r1NCAukKf

Activity

  1. isaaclem commented on Mar 9, 2018

    @isaaclem
    Contributor

    Similar issue to #17251

  2. added
    Issue: Author Provided Repro
    on Mar 9, 2018
  3. hramos commented on Mar 9, 2018

    @hramos
    Contributor

    Did this use to work on a prior version? This might have a higher priority if it's a regression.

  4. patricksmith commented on Mar 9, 2018

    @patricksmith
    Author

    @hramos I can't speak to if it recently stopped working -- I've only tried using this setting on v0.53.3 and v0.54.0 and it worked on neither version. There's a couple closed issues that suggest it was working previously working when specifying a borderRadius (which I did in this case); #17251 (comment), for example.

  5. allengleyzer commented on Mar 10, 2018

    @allengleyzer
    Contributor

    @hramos I can confirm that this was working on v0.48.4. A borderRadius value was required, but once set, dashed and dotted borders worked as expected.

    I can also confirm that the functionality broke as a result of this commit (and hence it stopped working in v0.51): 4994d6a

    (From the comments on the commit, it looks like it introduced other issues also.)

  6. added a commit that references this issue on Mar 10, 2018
  7. added
    Impact: Regression
    on Mar 12, 2018
  8. alikamts commented on Mar 16, 2018

    @alikamts

    I am facing the same issue. Do you resolved it?

  9. added
    Ran Commands
    on Mar 18, 2018
  10. added
    Platform: Android
    Ran Commands
    on Mar 18, 2018
  11. 7 remaining items

  12. idosofi commented on May 16, 2018

    @idosofi
  13. BrendanBerkley commented on May 22, 2018

    @BrendanBerkley
  14. hramos commented on May 24, 2018

    @hramos
    Contributor

    It's a known issue - no need to add more "me too" comments for now.

  15. BrendanBerkley commented on May 24, 2018

    @BrendanBerkley

    @hramos Good to know! I normally don't do +1 types of posts but react-native-bot was asking if it worked on the latest version, and the Old Version tag is still in place, so I felt a clarification was necessary.

  16. hramos commented on Jun 15, 2018

    @hramos
    Contributor

    Can people verify if this is fixed in 0.56.0-rc.1?

  17. added
    Resolution: Fixed
    on Aug 8, 2018
  18. nhayfield commented on Aug 31, 2018

    @nhayfield

    @hramos It is not fixed. I am getting same issue in 0.56.0-rc.1

  19. hramos commented on Aug 31, 2018

    @hramos
    Contributor

    @nhayfield can you open a new issue? Ideally, use 0.57.0-rc as that is the release we are working on releasing at the moment.

  20. locked as resolved and limited conversation to collaborators on Aug 31, 2018
  21. added
    Resolution: Locked
    on Aug 8, 2019
  22. added a commit that references this issue on Jan 14, 2022
  23. added a commit that references this issue on Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Impact: RegressionIssue: Author Provided ReproPlatform: AndroidRan CommandsResolution: FixedResolution: Locked

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions