我正在钛工作室中开发我的第一个应用程序。因此,我的项目由一个登录页面组成,如果登录成功,将在屏幕上填充一个表视图。
我遇到的问题是,在钛仿真器上,应用程序运行正常,但当我在设备上安装时,两个文本框和按钮丢失。
你知道我做错了什么吗?
对于移动网络来说,这款应用运行得很好。
谢谢。
代码:
var win = Titanium.UI.currentWindow;
var username = Titanium.UI.createTextField({
color:'#336699',
top:10,
left:10,
width:300,
height:40,
hintText:'Username',
keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(username);
var password = Titanium.UI.createTextField({
color:'#336699',
top:60,
left:10,
width:300,
height:40,
hintText:'Password',
passwordMask:true,
keyboardType:Titanium.UI.KEYBOARD_DEFAULT,
returnKeyType:Titanium.UI.RETURNKEY_DEFAULT,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
win.add(password);
var loginBtn = Titanium.UI.createButton({
title:'Login',
top:110,
width:90,
height:35,
borderRadius:1,
font:{fontFamily:'Arial',fontWeight:'bold',fontSize:14}
});
win.add(loginBtn);发布于 2013-12-10 21:56:51
对于android,
尝试删除属性borderStyle。它只适用于iphone。
还可以注释按钮的borderRadius和字体属性,然后尝试。如果你想使用borderRadius,那么你需要为它设置另外两个相对属性。borderWidth和borderColor。
要使用自定义字体,您需要首先对其进行配置,因此只需尝试注释该属性并尝试。
https://stackoverflow.com/questions/20372012
复制相似问题