简体   繁体   English

实现类似于标准 iPhone 短信聊天气泡视图的视图

[英]Implement view like standard iPhone SMS-chat bubbles view

Does anybody know how to implement such view, any tutorials, code examples, ideas.有谁知道如何实现这样的视图,任何教程,代码示例,想法。

Other good example of such view is Tweetie application that is on top of social networking appstore applications.这种观点的另一个很好的例子是 Tweetie 应用程序,它位于社交网络应用商店应用程序之上。 See first screenshot of that app on appstore.在 appstore 上查看该应用程序的第一个屏幕截图。

I appreciate any ideas on that.我很欣赏这方面的任何想法。

Here's the answer, with example code, direct from the source (the creator of Tweetie): http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/这是答案,带有示例代码,直接来自源(Tweetie 的创建者): http://blog.atebits.com/2008/12/fast-scrolling-in-tweetie-with-uitableview/

From the blog post: "The technique is extensible to pretty much any style cell you need - I use the same thing in Tweetie and draw the chat bubble, text, and avatar all together into a single view."来自博客文章:“该技术几乎可以扩展到您需要的任何样式单元格 - 我在 Tweetie 中使用相同的东西,并将聊天气泡、文本和头像一起绘制到一个视图中。” You can use - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight to create a stretchable chat bubble to put behind each cell in your table view您可以使用- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight创建一个可拉伸的聊天气泡,放在表格视图中的每个单元格后面

There are some thoughts on this here:这里有一些想法:

Creating a “chat bubble” user experience 打造“聊天泡泡”用户体验

Be sure to read the comments on the answers as well!请务必阅读对答案的评论!

Search for jsqmessagesviewcontroller , it's a good library.搜索jsqmessagesviewcontroller ,这是一个很好的库。

I'm pretty sure they're basically table-views with cells of different heights that are custom-drawn.我很确定它们基本上是带有自定义绘制的不同高度的单元格的表格视图。 You can do a lot by supplying your own background and content view's in a UITableViewCell.您可以通过在 UITableViewCell 中提供自己的背景和内容视图来做很多事情。

Check out the BubbleThingie sample code for example of how to do image bubbles with masking.查看BubbleThingie示例代码,了解如何使用蒙版制作图像气泡。 It also has example of how to do the text bubbles using a UIButton or UILabel.它还提供了如何使用 UIButton 或 UILabel 制作文本气泡的示例。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM