Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

asheshsj

macrumors newbie
Original poster
Oct 30, 2008
5
0
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

macrumors 6502a
Oct 4, 2003
726
333
NY
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

macrumors 65816
Jun 29, 2007
1,051
0
Use UIWebView and have the bubbles divs. Then just add the same margin to the bottom of each bubble.

Something like....

PHP:
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

macrumors newbie
Original poster
Oct 30, 2008
5
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.