0
我有ListView适配器和textview setLines不工作。textView.setLines(int行)不适用于textview。
方法内:
public View getView(int position, View convertView, ViewGroup parent) {
我有这样的代码:
holder.title.post(new Runnable() {
@Override
public void run() {
int lineCount = holder.title.getLineCount();
LogUtils.log("LINE_NUMBERS: " + lineCount+"");
if(lineCount == 2){
descriptionLineAmount = 6;
holder.description.setLines(descriptionLineAmount);
} else {
descriptionLineAmount = 4;
holder.description.setLines(descriptionLineAmount);
}
}
});
说明行数不改变(所述细胞不与额外行更新)。
您的XML中是否还有其他属性? –
标题和说明的maxlines 2的行被设置为4。 – jimbob