zachfitz / Ionic-Material

Material Design style and animations for Ionic
http://ionicmaterial.com
Other
2.9k stars 904 forks source link

ion-item swipe #181

Closed archangellcc closed 8 years ago

archangellcc commented 8 years ago

I'm trying to use ion-list and ion-item to get swipe to delete features and such.

<ion-list class="animate-fade-slide-in" >
            <ion-item ng-repeat="item in items"
                      item="item"
                      href="#" class="item-remove-animate"  ng-last-repeat="mylist">
                 {{ item.date }} {{ item.content }}
                <ion-option-button class="button-assertive" ng-click="edit(item)">
                    Edit
                </ion-option-button>
                <ion-option-button class="button-calm" ng-click="remove(item)">
                    Delete
                </ion-option-button>
            </ion-item>
</ion-list>

But,when swiping right, I found the button Edit and Delete is also visiable. It is different from ionic. How to solve it?

archangellcc commented 8 years ago

I find the answer. Step 1 Add ‘class="no_material" ’ to Step 2 Add the following code to style.css file.

.no_material .item, .item-complex .item-content{
   background-color:#fff;
}

Ensure the background-color of '.item' is not transparent.