Javascript 使用web移动框架?
我目前正在一个新的项目上实现一个移动应用程序。客户尚未决定,我必须提出几个解决方案。 需要与Android(版本2.2+)兼容,iOS和其他操作系统也可以。我们只能为Android开发,但我想使用web mobile框架 由于我从未使用过它们,我开始寻找现有的解决方案。我听说过PhoneGap、Titanium、Sencha Touch和jQuery Mobile 以下是我发现的可能性:Javascript 使用web移动框架?,javascript,cordova,jquery-mobile,sencha-touch,titanium,Javascript,Cordova,Jquery Mobile,Sencha Touch,Titanium,我目前正在一个新的项目上实现一个移动应用程序。客户尚未决定,我必须提出几个解决方案。 需要与Android(版本2.2+)兼容,iOS和其他操作系统也可以。我们只能为Android开发,但我想使用web mobile框架 由于我从未使用过它们,我开始寻找现有的解决方案。我听说过PhoneGap、Titanium、Sencha Touch和jQuery Mobile 以下是我发现的可能性: PhoneGap+senchatouch PhoneGap+jQuery Mobile(或同等产品) Se
- PhoneGap+senchatouch
- PhoneGap+jQuery Mobile(或同等产品)
- Sencha Touch(API+UI)
- 钛
我在过去几周里回顾了其他HTML5移动框架。我的评论可以在和找到。是的,你可以用钛合金来做。下面是一个简单的实现,在5分钟内起草并测试 为了让您了解它的外观,请参考以下内容。然后看看佩德罗·恩里克(Pedro Enrique)的《TiDraggable》(TiDraggable),如果你想增强它,让用户可以重新拖动文本或图像
// This app consists of two visual parts: a canvas where the user does stuff,
// and a save button in the bottom right.
var win = Ti.UI.createWindow({
backgroundColor: 'black'
});
// First, the canvas.
var canvas = Ti.UI.createView({
bottom: 50,
backgroundColor: 'white'
});
// It has a scroll view so the user can...
var scroll = Ti.UI.createScrollView({
// ... zoom content in or out.
maxZoomScale: 2, minZoomScale: 0.1,
// .. and freely position the image.
contentWidth: 1000, contentHeight: 1000
});
// Add the image to the middle of the scroll view.
scroll.add(Ti.UI.createImageView({
image: 'http://appc.me/Content/kitten.jpg',
width: 750, height: 426,
hires: true
}));
canvas.add(scroll);
// Add some text.
canvas.add(Ti.UI.createLabel({
text: 'Kittens are the best.', textAlign: 'center',
font: { fontSize: 28 },
color: '#000',
bottom: 20
}));
// Add the canvas to the win.
win.add(canvas);
// Second, create the "save" button.
var save = Ti.UI.createButton({
title: 'Save to Gallery',
height: 30, width: Ti.UI.SIZE,
bottom: 10, right: 10
});
save.addEventListener('click', function (evt) {
// Turn our "canvas" view (and its children) in to an image,
// and save it to the gallery.
Ti.Media.saveToPhotoGallery(canvas.toImage(), {
success: function () {
alert('Saved!');
},
error: function () {
alert('Oh no...');
}
});
});
// Add it to the win.
win.add(save);
win.open();