【发布时间】:2014-07-15 04:55:12
【问题描述】:
我在让 TableView 中的标签正确显示时遇到问题,希望有人能提供帮助。
这里是问题的截图:
后面带有 (...) 的标签被切断。 当我为行设置固定高度时不会出现此问题,但由于文本的长度不同,这对我来说不是一个好的解决方案。
我尝试了this question 中的答案,但无济于事。
这是我生成表格的代码:
var aSection = Ti.UI.createTableViewSection({
rows: [],
headerView: header
});
for (var p = 0; p < answers.length; p++){
var currentAnswer = answers[p];
var arow = Ti.UI.createTableViewRow({
selectedBackgroundColor:'#f5f5f5',
answID: currentAnswer['aId'],
map: currentAnswer['aMap'],
isSelected: false,
height: 'auto',
rightImage: '/images/icons/radio-unselected.png'
});
var atext = Ti.UI.createLabel({
font:{fontSize:gui.defaultFontSize+2, fontFamily: gui.defaultFont},
color: '#333',
text: currentAnswer['aText'],
left:10, top: 10, bottom: 10, right: 10,
width:'auto',
height: 'auto',
borderWidth: 0,
borderColor: "#000",
});
arow.add(atext);
aSection.add(arow);
}
var sections = [];
sections[0] = aSection;
var answView = Ti.UI.createTableView({
backgroundColor:'white',
data: sections,
bottom: 1,
minRowHeight: 40,
});
我真的很茫然。任何指针表示赞赏。
【问题讨论】:
标签: ios titanium tableview titanium-mobile