Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发聊天应用程序,我想根据文本拉伸聊天气泡图像,但不知道如何做到这一点。 请就此事提出您的建议。 谢谢
看着:
http://developer.apple.com/library/ios/documentation/uikit/reference/UIImage_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006890-CH3-SW4
UIImage *image = [[UIImage imageNamed:@"chatBubble.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:5];
这将创建一个角为 5x5 的图像,它不会拉伸,但身体会拉伸。