<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);">类似于熟知的聊天界面,至少会展示两种布局:对方发送的消息和本地发送的消息。这样的效果是通过ListView实现的,在ListView的适配器里面给予两种不同的布局。</span>
直接上代码吧,写的比较简单,也是为了给自己一个笔记同时和大家一起学习。
首先简单的写一个bean类:
package com.jt.myapplication;
public class Content {
private String content;
private int type;
@Override
public String toString() {
return "Content{" +
"content='" + content + '\'' +
", type=" + type +
'}';
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getContent() {
return content;
}
public