如何在 Titanium 中将文本字段居中?这是文本字段代码:
var textfield1 = Titanium.UI.createTextField({
color:'#006',
backgroundColor:'#fff',
height:50,
top:'auto',
left:'auto',
width:300,
borderStyle:Titanium.UI.INPUT_BORDERSTYLE_ROUNDED
});
最佳答案
如果您的父级使用垂直布局,它会自动居中。 'auto' 顶部将为 0 ;删除你的左边。 您还可以在其他布局中使用 textAlign : 'center'。
关于javascript - Titanium Mobile 中的文本字段居中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9146344/