Creating a – talk bubble – on the iPhone, like Tweetie – Stack Overflow

Без кейворда

I suggest using the open up method they recommend for button pics.

You can see a working example by downloading Twitterfon’s source(it’s on the FAQ page). You can see how they code a reusable control for it as well as example pictures for creating your own bubble.

Edit – Source is no longer available(NDA, possibly)

I put the pic up here. You should be able to figure out the rest 🙂

There is a movie tutorial displaying Jabs method here http://vimeo.com/8718829 it includes bubble graphics in many colours. Also the the twitterfon source is here https://github.com/jimpick/twitterfon

(these should be comments to jabs response but I don’t have high enough rating to comment)

You need to use your own photos, and Apple recommends using nine UIImageViews (Trio rows of Trio) (Top Left Corner, Top Middle, Top Right Corner, Middle Left Side, Middle, Middle Right Side, Bottom Left Corner, Bottom Middle, Bottom Right Corner)

Read the code in UICatalog’s ButtonsViewController.m: "+buttonWithTitle:" which creates a stretchable button from one picture, which is the same case for creating a talk bubble.

Check out AcaniChat. It’s the best open source version of the iPhone Messages app. It uses Core Data and will soon use WebSockets.

I stumbled across this today from one of my RSS feeds.

Its a bunch of UI elements re-created in illustrator

Notably they have the talk bubbles. You might be able to use them as a commence for pics to do what kdbdallas is telling.

Hope this helps.

It’s pretty effortless to make UILabels with stretchable picture background. If you are wanting to put pics in the bubble you’ll have to do some masking to get it to look like Apple’s. Check out the BubbleThingie sample code for example of how to do the pic masking. It also has example of how to do the text bubbles using a UIButton or UILabel.

Many of our applications have talk or messaging facility, and many of the clients are asking to build talk "similar to that iPhone’s SMS talk, with bubbles".

Unluckily, Cocoa SDK does not provide convenient and effortless way to display talk bubbles, and numerous code snippets that we’ve googled were not flawless either – some of them were simply ugly, some displayed bubbles of the same size regardless of text length, some did not alter bubble width, some were good, but scarcely customizable, etc.

Eventually, Alex – our leading iOS architect (who also happens to be the CTO at Stex) – went ahead and wrote this code from scrape. Main features are:

  • lightly (truly lightly!) customizable and embeddable. The code is based on the UITableView subclassing treatment, so once you need to add the talk facility to the app – consider this as simply adding the UITableView, where each cell is a messag
  • lightly customizable bubble’s color and style – there’s two pictures, that can be lightly tweaked in Photoshop
  • time grouping
  • limber bubble height and witdh

Related video:

Leave a Reply

Your email address will not be published. Required fields are marked *