我正在尝试使用Appcelerator创建我的第一个移动应用程序.当我尝试使用"leftImage"将本地图像加载到数组中时,图像不会显示.但是,当我将路径更改为不存在的东西时,它告诉我它无法找到路径.我已经google了很多,似乎无法找到我做错了什么.有什么帮助吗?
var win1 = Titanium.UI.createWindow(
{
title:'test',
className:'win1',
backgroundColor:'#000000'
}
);
var vdata = [
{leftImage:'appicons/cloudy.gif',title:"Schedule"},
{leftImage:'appicons/shows.png',height:60, title:"Shows"},
{leftImage:'appicons/search.png', title:"Search"},
{leftImage:'appicons/friends.png',title:"Friends"},
{leftImage:'appicons/settings.png',title:"Settings"}
];
var table1 = Titanium.UI.createTableView({
data:vdata
});
win1.add(table1);
win1.open();
Run Code Online (Sandbox Code Playgroud) android titanium appcelerator appcelerator-mobile titanium-mobile
可能重复:
setInterval()中的函数无延迟地执行
我试图每隔X几毫秒使用setTimeOut来调用calla函数,但它似乎只是吓坏了,无论我设置的时间范围如何都非常快?难道我做错了什么?
var Count = 0;
var GameRunning = 0;
var lblTimer = Titanium.UI.createLabel({
color:'#999',
text:'I am Window 1',
font:{fontSize:20,fontFamily:'Helvetica Neue'},
textAlign:'center',
width:'auto',
height: 25,
top: 25
});
var btnStartGame = Titanium.UI.createButton({
title: 'Start',
width: 50,
height: 25,
top: 75
});
function RunGame () {
Count++;
lblTimer.text = Count;
x = setTimeout(RunGame(), 100000);
}
function StartGame () {
if(GameRunning==0)
{
GameRunning = 1;
RunGame();
}
else
{
// Stop the game.
GameRunning = 0;
Count = 0; …Run Code Online (Sandbox Code Playgroud) 我试图从我的php api返回的这个json字符串中获取DishName.
json字符串是
["Spicy.com Specials",{"CatID":31,"CatName":"Spicy.com Specials","DishName":"Kashmiri Chicken","DishID":52,"DishDesc":"Cooked with lychees and banana in a lovely sweet and creamy sauce","DishPrice":6.99,"CatDescription":" "},{"CatID":31,"CatName":"Spicy.com Specials","DishName":"Telapia Fish","DishID":51,"DishDesc":"Lightly spiced fillet, a very popular white fish made with peppers, onions and spices in medium sauce","DishPrice":6.99,"CatDescription":" "},
Run Code Online (Sandbox Code Playgroud)
我的钛码是
var cats = eval('('+this.responseText+')');
alert(cats[0]);
Run Code Online (Sandbox Code Playgroud)
这得到我'Foo.com特价'然而我需要DishName,任何帮助将非常感谢谢谢
有没有像Ti.UI.CurrentWindow返回当前tabgroup那样的方法Ti.UI.CurrentTabGroup?
我想在其中一个应用程序选项卡中为当前选项卡组添加选项卡?
我想用钛开发一个移动应用程序.在开始之前,我应该首先使用钛工作室配置SVN和jenkins.我已经在jenkins服务器上安装了一个插件svn:subversion插件,在chrome studio上安装了另一个名为Eclipse插件的插件.现在我想用jenkins配置钛.我搜索了jenkins插件,我发现了一个名为:android lint插件的插件.
我还必须安装它吗?
我在滚动视图中添加了一个表视图,它在iOS的情况下顺利工作,但在Android的情况下,表视图不滚动.
我已经描述了下面描述我的问题的代码.建议我任何可以帮助解决我的问题的答案.
var rows = [];
var win = Ti.UI.createWindow({
backgroundColor:'white'
});
var scrollableView = Ti.UI.createScrollView({
top : 0,
contentWidth : '100%',
contentHeight : 'auto'
});
var fruit = Ti.UI.createView({
top : 40,
width : '70%',
height : 20,
left : 10,
backgroundColor:'#000'
});
var fruitLabel = Ti.UI.createLabel({
text : "Fruit list",
font:{
fontSize : 15,
fontWeight : 'bold'
},
color : 'red'
});
fruit.add(fruitLabel);
var fruitTableView = Titanium.UI.createTableView({
top : 70,
width : 200,
height : 150,
left : …Run Code Online (Sandbox Code Playgroud) 我的开发平台iOS.我的开发SDK 5.1.0.我在设备上通过开发ipa测试我的应用程序时遇到了[LiveView]服务器不可用的奇怪错误.在此之前,我总是通过Titanium Studio开发ipa,但是由于Titanium Studio中iOS sdk的一些配置问题,我转而使用Appcelerator Studio.我能够从Appcelerator Studio成功开发ipa,但是当我在我的设备上安装并运行时,LiveView服务器始终存在错误.有没有其他人遇到这个问题然后做回复我必须将测试版本发送到我的客户端进行测试.错误图片
在我的钛金应用程序上,我有一个包含许多字段的表单(文本字段等),当我专注于文本字段时,它会显示ios键盘,当我在窗口上的某个位置单击时,我想隐藏它:
<Alloy>
<Window id="home" >
<View id="form">
<Require type="view" id="myViewForm" src="form/etape_1" />
</View>
</Window>
</Alloy>
Run Code Online (Sandbox Code Playgroud)
在myViewForm内部:
<Alloy>
<View>
<TextField id="name" hintText="name"/>
<TextField id="telephone" hintText="Téléphone"/>
</View>
</Alloy>
Run Code Online (Sandbox Code Playgroud)
注意:如您所见,我有一个ID为“ telephone”的文本字段,将仅显示数字。
在我的控制器主文件上:
/*-----------------------------------------
| | EVENT LISTENER CLICK ON WINDOW
-------------------------------------------*/
$.home.addEventListener("click", hideSoftKeyboard);
/*-----------------------------------------
| | HIDE KEYBOARD
-------------------------------------------*/
function hideSoftKeyboard(e){
if(Ti.Platform.osname === 'android'){
Ti.UI.Android.hideSoftKeyboard();
} else {
$.home.textField.blur();
}
}
Run Code Online (Sandbox Code Playgroud)
在android上运行良好,但是在ios上我遇到以下错误:
[ERROR] : Script Error {
[ERROR] : column = 103;
[ERROR] : line = 12;
[ERROR] : message = "undefined is …Run Code Online (Sandbox Code Playgroud) titanium appcelerator appcelerator-mobile titanium-mobile appcelerator-titanium
嗨,我已经尝试了appcelerator团队建议的解决方法(用于处理6.0.0版中对ti.include的弃用)
function include(file) {
return eval(Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, file).read().text);
}
Run Code Online (Sandbox Code Playgroud)
我得到一个错误,可能是系统无法读取文件。错误是:
[错误]:TiBlob:java.io.FileNotFoundException:资源/下划线-min.js
我已经设法通过.getDirectoryListing()列出了目录文件,但找不到该文件,实际上我在那里找不到任何.js文件。
有什么建议么?
我正在尝试使用Appcelerator Studio但是当它启动时我无法在文本框上写下我的电子邮件.
更新:我忘了提到我在Linux Ubuntu 16.04上
我可以按下按钮或单击链接,但我无法在"电子邮件"或"密码"字段中插入任何文本,它们似乎已被禁用或有一个错误,即使我点击它也不会关注它们:
这是控制台堆栈跟踪:
? Appcelerator_Studio ./AppceleratorStudio
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
(Build 4.8.1.1480393991) [ERROR] null
java.lang.InterruptedException
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:502)
at java.lang.UNIXProcess.waitFor(UNIXProcess.java:395)
at com.aptana.core.util.ProcessRunner.processData(ProcessRunner.java:381)
at com.aptana.core.util.ProcessRunner.processData(ProcessRunner.java:345)
at com.aptana.core.util.ProcessRunner.processResult(ProcessRunner.java:432)
at com.appcelerator.titanium.core.internal.cli.NodeAppcCLI.runCommand(NodeAppcCLI.java:238)
at com.appcelerator.titanium.rcp.handlers.TitaniumSplashHandler.verifyAppcWhoami(TitaniumSplashHandler.java:1236)
at com.appcelerator.titanium.rcp.handlers.TitaniumSplashHandler.access$4(TitaniumSplashHandler.java:1233)
at com.appcelerator.titanium.rcp.handlers.TitaniumSplashHandler$3.run(TitaniumSplashHandler.java:321)
(Build 4.8.1.1480393991) [ERROR] Failed to check login status. Likely not logged in.
Run Code Online (Sandbox Code Playgroud) titanium appcelerator appcelerator-titanium appcelerator-studio
titanium ×10
appcelerator ×5
android ×3
filesystems ×1
include ×1
ipa ×1
javascript ×1
json ×1
liveview ×1
mobile ×1
scrollview ×1
setinterval ×1
settimeout ×1
tableview ×1
tabs ×1