<UI>实现背景拉伸的方法(聊天气泡)
2012-11-10 16:02
246 查看
方法1:能够使得背景图片可以拉伸。
//这个方法两个参数分别表示左边和上边不拉升的像素
UIImageView *bubble=[[UIImageView alloc] initWithImage:[image stretchableImageWithLeftCapWidth:10 topCapHeight:10]];
方法2:
[theMainView setBackgroundColor: [UIColor colorWithPatternImage: [UIImage imageNamed: @"bg.png"]]];
UIView *theMainView =[ [UIView alloc] init]; UIImage *image = [UIImage imageNamed:@"bg.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image] ; [theMainView addSubview:imageView];
//这个方法两个参数分别表示左边和上边不拉升的像素
UIImageView *bubble=[[UIImageView alloc] initWithImage:[image stretchableImageWithLeftCapWidth:10 topCapHeight:10]];
方法2:
[theMainView setBackgroundColor: [UIColor colorWithPatternImage: [UIImage imageNamed: @"bg.png"]]];
相关文章推荐
- 艾伟_转载:数组排序方法的性能比较(中):Array.Sort<T> 实现分析
- openfire+spark+amack 即时聊天--------<1>背景知识
- <数据结构>单链表元素按插入方法排序实现
- AJAX跨域方法之一—使用<script>实现
- <转>统计源代码行数的一些实现方法
- jquery<=======>js实现方法
- myBatis 实现用户表增删查改操作<方法1 没有使用接口的>(最终版)
- python 7-5 如何让类支持比较操作lt/le/total_ordering可以简化此过程,实现lt eq 后,可以推测出<= >=方法
- <UI>点击UIImageView实现相册的调用
- <a>标签中href和onclick传递this对象的实现方法
- asp.net 实现省市级联-----<简单方法1>
- Android 使用<layer-list>实现微信聊天输入框
- Lance老师UI系列教程第六课->微信聊天气泡界面的实现
- 关于JSP中单击任意标签弹出文件选择框(<input type="file"/>)的实现方法
- css3实现三角形,聊天背景气泡,心形等形状
- 工作总结 for 另类写法 循环加时间 集合合并 也是用的 static class Enumerable (IEnumerable<T>的扩展方法) (IEnumerable<T> 的 工具类) (所有集合 数组都实现IEnumerable<T>)
- 数组排序方法的性能比较(2):Array.Sort<T>实现分析
- 冒泡排序C#实现,使用委托,包括三种方式:Fun<>,匿名方法,Lambda表达式
- 用Parallel.For()和Parallel.For<TLocal>()方法实现并行运行迭代
- 实现<table>标签的动态新增和后台接受<table>标签的方法