Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display dotted line in react native

I need to display a dotted line in a view

I have tried borderTopWidth: 1, borderStyle: 'dashed' for a view.

like image 999
Alice Bob Avatar asked Apr 09 '19 08:04

Alice Bob


People also ask

How do you insert a line break in react?

In React, you use the self-closing <br> tag to produce a line break between the text or a section, whereas in HTML you'd use <br> …

How do you add a line in react native?

To insert a line break into a text component in react native we can add the {'\n'} character string or add the next line in the string literal.


2 Answers

You can try this one also, it give you perfect dotted line.

<View style={{borderWidth:0.3, borderStyle:'dashed', borderRadius:1,borderColor:'black'}}></View>
like image 64
Pravin Ghorle Avatar answered Sep 19 '22 09:09

Pravin Ghorle


Just add borderRadius it will work

<View style={{
    borderStyle: 'dotted',
    borderWidth: 1,
    borderRadius: 1,
  }}>
</View>
like image 24
Masuk Helal Anik Avatar answered Sep 21 '22 09:09

Masuk Helal Anik