02-UITableview(4)

2016-11-25  本文已影响4人  cdd48b9d36e0

0606聊天布局

1. 01-聊天布局01-图片拉伸

图片拉伸的三种方式:

// 拉伸处理(说明需要保护的区域)
UIImage *image = [UIImage imageNamed:@"chat_send_nor"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 30, 30, 30) resizingMode:UIImageResizingModeStretch];
//这个方法直接就传长和宽的一半就行了
UIImage *image = [UIImage imageNamed:@"chat_send_nor"];
image = [image stretchableImageWithLeftCapWidth:image.size.width * 0.5 topCapHeight:image.size.height * 0.5];
// left
// top
// width
// height
// right = width - left - 1;
// 1 = width - left - right;
// bottom = height - top - 1;
// 1 = height - top - bottom;

第三种是直接在xcassets里面选中图片点击sllcing进行设置

2. 01-聊天布局01-图片拉伸

3. 04-聊天布局04-键盘处理

为什么通知必须在dealloc里移除
一个addObserver操作会在通知中心里产生一个指针指向该通知的观察者,如果dealloc的时候不移除,那么只要通知被再次触发通知中心就会根据这个指针也就是地址去给这个观察者发送消息,这其实就是操作野指针了

4. 07-app图标和启动图片

设置Icon时spotlight里的图片是提供搜索时用的;设置时全选拖进去,会自动帮你填好

5. 11-代理设计模式

代理、通知与KVO的区别:

上一篇 下一篇

猜你喜欢

热点阅读