Maintaining spacing between chat bubbles

Discussion in 'iOS Programming' started by asheshsj, Dec 19, 2008.

  1. macrumors newbie

    Joined:
    Oct 30, 2008
    #1
    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
     
  2. macrumors 6502

    Joined:
    Oct 4, 2003
    Location:
    NY
    #2
    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.
     
  3. macrumors 65816

    Joined:
    Jun 29, 2007
    #3
    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>
     
  4. thread starter macrumors newbie

    Joined:
    Oct 30, 2008
    #4
    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
     

Share This Page