Gendaful
Gendaful

Reputation: 5802

How to implement iPhone look alike alert boxes in sencha touch?

I am trying to implement the alert boxes in sencha touch application which looks similar to iPhone alert boxes.

I have used Ext.Msg.alert('', 'Hello World') to implement the alert boxes but it looks different from iPhone alert boxes. I have attached both the images for reference.iPhoneAlertBox

Sencha Alert box

Any guidance will be very helpful.

Thank you,

Upvotes: 0

Views: 1032

Answers (1)

Adnan Zafar
Adnan Zafar

Reputation: 31

First you need to add

requires: ['Ext.device.Notification'] 

to register notification method then use below code to alert

Ext.device.Notification.show({
    title: 'Test Adi',
    message: 'Is your email address is: [email protected]',
    buttons: Ext.MessageBox.OKCANCEL,
    callback: function(button) {
        if (button == "ok") {
            console.log('Verified');
        } else {
            console.log('Nope.');
        }
    }
});

instead of

Ext.Msg.alert('', 'Hello World')

Upvotes: 3

Related Questions