我用IONIC-2測試版製作了一個應用程序。我是使用複選框報警控制器,並要添加圖像一樣,複選框警報控制器 - 顯示圖像
我的代碼是
showCheckbox() {
let alert = this.alertCtrl.create();
alert.setTitle('Which planets have you visited?');
alert.addInput({
type: 'checkbox',
label: 'Alderaan',
value: 'value1',
checked: true
});
alert.addInput({
type: 'checkbox',
label: 'Bespin',
value: 'value2'
});
alert.addButton('Cancel');
alert.addButton({
text: 'Okay',
handler: data => {
console.log('Checkbox data:', data);
this.testCheckboxOpen = false;
this.testCheckboxResult = data;
}
});
alert.present();
}
是可以添加圖片這樣?
如果有人知道解決方案,請幫助我。
謝謝。
@TedNyberg:我試過上面的代碼,並按照這個[文檔](http://ionicframework.com/docs/v2/api/components/alert/AlertController/)。 –