PDA

View Full Version : Maintaining spacing between chat bubbles




asheshsj
Dec 19, 2008, 10:53 AM
Hi All,

Can someone please help me on how to maintain an equal distance between different bubbles in a chat window. I am building an application which requires for us to have a chat module with Iphone style Bubbles.

I tried both UIWebView and UITableView but cannot maintain an equal spacing between different bubbles.

Thanks,
- A



jsnuff1
Dec 19, 2008, 01:43 PM
UIScrollView is probably the best way to go for this. Build your chat bubbles via UIImageView and UILabel and then add them to the UIScrolView with a certain Y position offset from the last chat bubble.

Should be pretty easy to do.

detz
Dec 19, 2008, 01:53 PM
Use UIWebView and have the bubbles divs. Then just add the same margin to the bottom of each bubble.

Something like....

div.bubble{
margin-bottom:10px;
}

<div class="bubble">This is a message</div>
<div class="bubble">This is a another message</div>
<div class="bubble">This is a final message</div>

asheshsj
Dec 20, 2008, 12:41 AM
Thanks for the quick reply, but I am using UITableView as it supports scrolling. (I need to maintain the chat history between users). Can you suggest something in regards to this.

Thanks,
- A