2016-08-30 15 views
0

我用IONIC-2測試版製作了一個應用程序。我是使用複選框報警控制器,並要添加圖像一樣,複選框警報控制器 - 顯示圖像

this

我的代碼是

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(); 

}

是可以添加圖片這樣?

如果有人知道解決方案,請幫助我。

謝謝。

+0

@TedNyberg:我試過上面的代碼,並按照這個[文檔](http://ionicframework.com/docs/v2/api/components/alert/AlertController/)。 –

回答

1

恐怕這是不可能的AlertController。您可以使用ModalControllerinfo)顯示自定義頁面,並在該頁面中使用Grid創建該佈局,但根據外觀和感覺,結果會稍有不同。

+0

很多很多,謝謝。是的,我也認爲這一點。讓我試試ModalController並儘快更新。 :) –

+1

只需使用模態控制器並獲得相同。謝謝@sebaferreras:你有+1。非常感謝天才。 :) –

+1

很高興我可以幫助:) – sebaferreras