제가 지금 카카오톡 대화 처럼 수신자와 송신자의 채팅창을 좌우로 나누려고 하는데 어떻게 해야 하나요?
송신자와 수신자의 text.xml을 따로 만들어 gravity를 좌우로주기도 해보고 하나의 text.xml을 경우에 따라 gravity를 바꾸게 해보기도 했지만 원하는데로 정렬이 되지 않습니다.
해결해 주시면 감사하겠습니다.
어댑터 소스 입니다.
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (chatSide)
v = vi.inflate(R.layout.chat_left, null);
else
v = vi.inflate(R.layout.chat_right, null);
}
MsgBox p = items.get(position);
if (p != null) {
TextView textBox = (TextView) v.findViewById(R.id.msg_left);
TextView textBox1 = (TextView) v.findViewById(R.id.msg_right);
if (chatSide) {
if (textBox != null)
textBox.setText(p.getMsg());
} else {
if (textBox1 != null)
textBox1.setText(p.getMsg());
}
}
return v;
}
왼쪽 오른쪽 출력은 이제 되는데 출력할때마다 순서가 뒤죽박죽이 되어버립니다. ㅜㅜ




방법이 무궁무진하네요...ㅋㅋ
작성자님이 말씀하신것처럼도 충분히 가능한대 왜 안될까요?? 흠... 소스를 봐야 답변을 드릴수 있겟네요...