Titanium Mobile iOS Module project for TTAlertView
- Run
build.py
which creates your distribution - cd to
/Library/Application Support/Titanium
- copy this zip file into the folder of your Titanium SDK
Register your module with your application by editing tiapp.xml
and adding your module.
Example:
<modules>
<module platform="iphone" version="0.1">com.qnyp.tittalert</module>
</modules>
For example
var tittalert = require('com.qnyp.tittalert');
var ttalert = tittalert.createView({
'title': 'single button alert',
'message': 'Message',
'cancelButtonTitle': 'キャンセル'
});
ttalert.show();
single button alert
tittalert.createView({
'title': 'single button alert',
'message': 'message here',
'cancelButtonTitle': 'cancel'
});
two button alert
tittalert.createView({
'title': 'two button alert',
'message': 'message here',
'cancelButtonTitle': 'cancel'
'otherButtonTitles': ['OK']
});
three button alert
tittalert.createView({
'title': 'three button alert',
'message': 'message here',
'cancelButtonTitle': 'cancel'
'otherButtonTitles': ['ONE', 'TWO']
});
click event
ttalert = tittalert.createView({
'title': 'two button alert',
'message': 'message here',
'cancelButtonTitle': 'cancel'
'otherButtonTitle': 'OK'
});
ttalert.addEventListener('click', function(e){
if(e.cancel) {
// canceled
}
if(e.index == 1) {
// ok
}
});
You can change backgroundImage.
Images are in assets
directory.
Example app is in example
directory.
MIT License