iOS聊天气泡的处理——图片拉伸resizableImageWithCapInsets:resizingMode
来源:互联网 发布:淘宝店铺设计教程视频 编辑:程序博客网 时间:2024/04/30 17:39
- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(UIImageResizingMode)resizingMode
很多时候要对图片某个地方进行一个拉伸处理,从而达到想要的效果,例如 聊天的对话框,短信的对话框。
例如 当显示的是字数很多或者很多行的时候,不确定高度,但是显示的图片只有一张,那么我们可以对这张图片进行一个处理,拉伸某个区域进行适配。只要你确定了 需要拉伸的区域,再加上你定义好那个UIImageView 的frame 那么就会自动处理好了。
上面这种图片要拉伸的区域 就是绿色箭头指向的部分(个人的情况视情况而定,拉伸的区域要算好)
例如我这张的处理代码就是
imageView.image = [[UIImage imageNamed:@"haha.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(17, 10, 10, 20) resizingMode:UIImageResizingModeStretch];
就可以达到拉伸图片,从而适应对话框的 宽 和 高。
0 0
- iOS聊天气泡的处理——图片拉伸resizableImageWithCapInsets:resizingMode
- resizableImageWithCapInsets:resizingMode 图片拉伸 使用方法
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS图片拉伸技巧—— resizableImageWithCapInsets
- iOS编程——Swift使用resizableImageWithCapInsets来拉伸图片
- iOS图片拉伸技巧—— resizableImageWithCapInsets/stretchableImageWithLeftCapWidth
- UIImageResizingModeStretch聊天气泡的图片拉伸
- UIImageResizingModeStretch聊天气泡的图片拉伸
- ios 图片拉伸resizableImageWithCapInsets:详解
- 深入理解iOS API系列(二)UIImage的resizableImageWithCapInsets:resizingMode:
- ios开发 - iPhone图片拉伸:resizableImageWithCapInsets
- IOS UIImage图片拉伸技巧-resizableImageWithCapInsets
- Hive 之 常用函数
- 解决网页的返回上一页的问题,python后端
- [noip2010tg] 机器翻译
- 模型选择和特征选择经验总结
- 超长单词、文本的显示(多行省略隐藏、单行省略隐藏、强制多行显示)
- iOS聊天气泡的处理——图片拉伸resizableImageWithCapInsets:resizingMode
- 【深度学习理论3】ALexNet模型的详解
- hibernate底层的分页如何提高查询速度?
- tomcat启动报错
- 在SpringMVC中获取request对象的几种方式(转)
- 使用jQuery的attr方法来修改onclick值
- React Native 中 component 生命周期
- 利用dll导出lib
- 对象排序