以下代码在Chrome和Firefox中完美运行,但我无法在IE中运行。我尝试了display: -ms-flexbox
,但没有用。
HTML:
<div class="contener">
<span class="editableLabel">
<span class="contentTrimmed">aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn</span>
</span>
</div>
CSS:
.contener {
width: 300px;
}
.editableLabel {
display: flex;
}
.contentTrimmed {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
我想要获得的结果是修剪后的文本,如果它长于300px。
答案 0 :(得分:0)
class WQPlaneCell: UITableViewCell {
@IBOutlet private weak var thumbnailImage: UIImageView!
@IBOutlet private weak var planeNoLabel: UILabel!
@IBOutlet private weak var planeTypeLabel: UILabel!
@IBOutlet private weak var ownerLabel: UILabel!
override func layoutSubviews() {
super.layoutSubviews() // This is important, don't forget to call the super.layoutSubviews
.... // do anything you want
}
}
&#13;
.contener {
width: 300px;
}
.editableLabel {
display: flex;
}
.contentTrimmed {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: 300px;
}
&#13;