Adding an icon to the right of an Avatar - Ionic

怎甘沉沦 提交于 2019-12-25 08:49:41

问题


I'm looking ti add an icon to the right of an ionic avatar list item.

My code:

<ion-item class="animated flipInX item-divider gold" ng-show="(myArray.length > 0)">My Stuff</ion-item>
        <div ng-repeat="item in array">
          <ion-list>
            <ion-item class="animated flipInX item-avatar" ng-click="showAcceptRequest(item)">
              <img ng-src={{item['Picture']}}>
              <h2>{{item['SenderName']}}</h2>
              <p>{{item['EntityName']}}</p>
            </ion-item>
        </div>
        </ion-list>

This shows an avatar picture with there name and some sub-info. I'd like to add an ionicon to the right of this cell but my positioning is all off. Can someone shed some light?

Such as:

<i class="icon ion-ios-telephone-outline"></i>

JSFiddle:

http://jsfiddle.net/m3x6nb1d/8/

Basically want the icon to be level on the right of the table cell...


回答1:


This worked for me, pasting my example, try to re-create

<ion-content>
    <ion-list class="item-icon-right">
        <ion-item>
                <i class='icon ion-social-facebook'> </i> Facebook
        </ion-item>
    </ion-list>
<ion-content>

So yeah, item-icon-right class should do the job.

Works with normal icons,if it doesn't work with images then you should see how to add image to the right with img align attribute. Example http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_img_align



来源:https://stackoverflow.com/questions/39987376/adding-an-icon-to-the-right-of-an-avatar-ionic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!