0
我是新來的離子,我想創建一個離子模式,應單擊按鈕打開圖像。 我應該使用模態還是離子彈出來實現這個功能?有人能幫助我嗎? 在此先感謝。按鈕單擊打開離子圖像模式
我是新來的離子,我想創建一個離子模式,應單擊按鈕打開圖像。 我應該使用模態還是離子彈出來實現這個功能?有人能幫助我嗎? 在此先感謝。按鈕單擊打開離子圖像模式
我會使用模態窗口。在控制器(請記住,包括$ ionicModal在構造函數中的參數):
// Init dialog
$ionicModal.fromTemplateUrl(
'templates/show-image.html', {
scope: $scope, animation: 'slide-in-up'
}).then(function(modal) {
$scope.modalView = modal;
}
);
// Open dialog
$scope.buttonClick = function() {
$scope.myimage = '...';
$scope.modalView.show();
};
和模態模板顯示,image.html:
<ion-modal-view>
<ion-header-bar class="bar-calm">
<h1 class="title">My Image</h1>
<div class="buttons"><button class="button button-clear" ng-click="modalView.hide()"><i class="icon ion-close"></i></button></div>
</ion-header-bar>
<ion-content>
<img ng-src="myimage" />
</ion-content>
</ion-modal-view>
我實現這個使用自定義彈出..謝謝反正@Mat – user3415447
我實現了這個使用自定義popup..Thanks反正 – user3415447