Ionic item with left and right aligned text

前端 未结 8 2445
半阙折子戏
半阙折子戏 2021-02-19 23:38

I have an ionic item in an ionic list. What is the best way to left align the first text and right align the second text?

  
相关标签:
8条回答
  • 2021-02-20 00:10

    you can use css "text-align" property to do that

    <div class="item row">
      <span style="text-align:right" class="col col-50">first</span>
      <span style="text-align:left" class="col col-50">second</span>
    </div>
    

    Hope this fix your problem

    0 讨论(0)
  • 2021-02-20 00:20

    With Ionic 3 the above answers did not work. With ion-items you can simply leave the left text untouched because it is left-aligned by default. With the text that you want to right-align, simply use the item-end decorator like this:

    <ion-item>
         Name <span item-end>Zack</span>
    </ion-item>
    
    0 讨论(0)
提交回复
热议问题