我一直在使用来自SmartFace.io的示例代码,如下所示:
pick(
myCars,
selectedIndex,
function(e) {Pages.NewPage.Label1.text = myCars[e.index]; selectedIndex = e.index; },
function() {},
function() {}
);但是,选择器只是不想在模拟器中显示。我还尝试将这些代码放入一个分隔函数中,并从ImageButton的一个ImageButton事件中调用它,但仍然什么也没有。
我正在iPhone 4S上尝试这个,所以也许这就是问题所在.
对我所做的任何不正确的暗示都将不胜感激。
谢谢格里
发布于 2015-03-23 07:00:36
我只需添加一个TextButton和标签到Page1并编写这些codeLines。它起作用了;也许,其他一些代码破坏了这些功能。
var myCars = ["Audi", "Volvo", "Volkswagon"];
var selectedIndex = 0;
/**
* Creates action(s) that are run when the user press the key of the devices.
* @param {KeyCodeEventArguments} e Uses to for key code argument. It returns e.keyCode parameter.
* @this SMF.UI.Page
*/
function Page1_Self_OnKeyPress(e) {
if (e.keyCode === 4) {
Application.exit();
}
}
/**
* Creates action(s) that are run when the page is appeared
* @param {EventArguments} e Returns some attributes about the specified functions
* @this SMF.UI.Page
*/
function Page1_Self_OnShow() {
//Comment following block for removing navigationbar/actionbar sample
//Copy this code block to every page onShow
header.init(this);
header.setTitle("Page1");
header.setRightItem("RItem");
header.setLeftItem();
/**/
}
/**
* Creates action(s) that are run when the object is pressed from device's screen.
* @param {EventArguments} e Returns some attributes about the specified functions
* @this SMF.UI.TextButton
*/
function Page1_TextButton1_OnPressed(e){
pick(
myCars,
selectedIndex,
function(e) {Pages.NewPage.Label1.text = myCars[e.index]; selectedIndex = e.index; },
function() {},
function() {}
);
}https://stackoverflow.com/questions/29186897
复制相似问题