Stanislav Sergeev
Stanislav Sergeev

Reputation: 31

React Native Add two Side border to View does not work

I want to add Left and Bottom Border to View in React Native.

This is my code

dashedBorderView: {
    position: 'absolute',
    bottom: 35,
    left: 45,
    top: 50,
    right: 0,
    borderLeftWidth: 1,
    borderBottomWidth: 1,
    borderColor: '#dfdfdf',
    borderStyle: 'dashed',
  },

But it doesn't show any borders.

But if I do like follow, four side borders show.

dashedBorderView: {
    position: 'absolute',
    bottom: 35,
    left: 45,
    top: 50,
    right: 0,
    borderWidth: 1,
    borderColor: '#dfdfdf',
    borderStyle: 'dashed',
  },

Please guide me. Thanks.

Upvotes: 1

Views: 4328

Answers (1)

patelarpan
patelarpan

Reputation: 8011

Use following property for specific border color

  borderLeftColor: '#dfdfdf',
  borderBottomColor: '#dfdfdf'

Or

  borderWidth: 1, 
  borderColor: '#dfdfdf',
  borderTopColor: transparent
  borderRightColor: transparent

Upvotes: 1

Related Questions