5

I tried "hr" tag in component html file in nativescript-angular. But it doesn't shown horizontal line in simulator. (tested with ios simulator)

  <StackLayout>
     hr>
     <Label horizontalAlignment="left" textWrap="true" text="Description" class="description-text"></Label>
     </StackLayout>
Stephen
  • 9,899
  • 16
  • 90
  • 137

2 Answers2

11

Shouldn't that hr go as a class inside the StackLayout?

Like <StackLayout class="hr-light">...

Reference

Dzhavat Ushev
  • 725
  • 4
  • 13
1
<Label class="line" text="About"></Label>

// To give the bottom border

.about-heading{
    font-size: 19;
    padding: 5 18;
    border-color: #3BEC9C;
    border-width: 0 0 2 0;
}

// To give the top border

.about-heading{
    font-size: 19;
    padding: 5 18;
    border-color: #3BEC9C;
    border-width: 2 0 0 0;
}
MartenCatcher
  • 2,713
  • 8
  • 26
  • 39
ixhimanshu
  • 77
  • 5
  • This should be the recommended answer. For the sake of performance, using one StackLayout (equates to one native container) for a horizontal line, is not efficient. – Keith OYS Oct 14 '20 at 07:46