问题
I'm trying to change the width of $ionicPopup; I've tried using the following css code, to import it onto cssClass: my-popup
:
.my-popup {
width: 400;
}
But that didn't seem to work.
I've really got stuck there, and currently unable to find a solution.
Any help will be much appreciated. Thank you.
回答1:
Place the following in the src/theme/variables.scss file;
$popover-ios-width: 300px;
回答2:
It's actually quite straight forward, see the following example:
var pinPopup = $ionicPopup.show({
templateUrl : 'app/user-profile/user-pin.html',
title: '4-digit Security PIN',
scope : $scope,
cssClass: 'my-popup',
buttons : [
{
text : 'Cancel',
},
{
text : '<b>Save</b>',
type: 'button-positive',
onTap : function(e) {
var val = document.getElementById('pin-output').value;
$scope.userRow.password = val;
}
}
]
})
Now in your CSS simply do:
.my-popup .popup {
width: 400px;
}
来源:https://stackoverflow.com/questions/37482232/ionic-how-is-it-possible-to-change-the-width-of-ionicpopup