![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ios
feihu13579
这个作者很懒,什么都没留下…
展开
-
IOS中UITableView滚动到指定位置_IOS
方法很简单:- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated有些需要注意的地方:如果在reloadData后需要立即获取tableview的ce转载 2017-06-21 21:18:43 · 2059 阅读 · 0 评论 -
获取工程中window上面的RootViewController
你一般怎么获取工程中window上面的RootViewController第一种方法: UIWindow *window = [UIApplication sharedApplication].keyWindow; UIViewController *rootViewController = window.rootViewController;第二种方法: AppDel转载 2017-08-17 22:23:56 · 367 阅读 · 0 评论 -
iOS运行报错,主要跟线程有关
iOS app运行时报错:This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.转载 2017-08-17 22:16:57 · 2219 阅读 · 0 评论 -
iOS指定页面屏幕旋转
在网上找了好久,大多数都是一样的使用起来没有效果,后来发现这个方法,确实好使。首先在target中设置在AppDelegate.m中- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{原创 2017-07-22 09:46:40 · 286 阅读 · 0 评论 -
聊天文字在气泡背景图片上的展示
- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight 这个函数是UIImage的一个实例函数,它的功能是创建一个内容可拉伸,而边角不拉伸的图片,需要两个参数,第一个是左边不拉伸区域的宽度,第二个参数是上面不拉伸的高度。根据设转载 2017-06-21 22:48:40 · 5133 阅读 · 0 评论 -
iOS制作聊天气泡
现在几乎所有的社交类APP都会需要做气泡聊天界面,而对于没有做过的同学来说还是有一定难度的。那么这篇博文就是记录一下我自己在实现过程遇到一些问题和解决办法。先来几张截图给大家看看最终的结果:这是一般状态IMG_3029.PNG这是长按弹出菜单状态IMG_3030.PNG这是编辑模式IMG_3031.转载 2017-06-21 22:42:47 · 743 阅读 · 0 评论 -
CGContextAddArcToPoint和CGContextAddArc的绘图使用
比较难的是CGContextAddArcToPoint 代码如下:[plain] view plain copyCGContextRef context=UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(context,1,0,0,1); CGContextMov转载 2017-06-21 22:34:19 · 263 阅读 · 0 评论 -
在 UITableView的底部插入新的cell
//添加cell到tableView中 NSIndexPath * newIndexPath = [NSIndexPathindexPathForRow:self.historyArr.count-1inSection:0]; [self.chatTableViewbeginUpdates]; [self.chatTableViewinsertR原创 2017-06-21 22:11:03 · 1731 阅读 · 0 评论 -
使用block遇到的问题
在写代码的时候用到了block:/** * 点击发送后要发送的文本 */@property (nonatomic,copy)void(^sendContent)(NSObject *content);在调用的时候需要在block里面刷新tableView,但是发现视图层显示的cell存在问题,cell的数据显示为进入重用池之前cell的数据,后来经过修改:se原创 2017-06-21 21:40:42 · 856 阅读 · 0 评论 -
项目中曾经遇到过的问题整理
分类UILabel标签控件UISearchBar搜索条UIAlertController警告框UIPickerView选择器UITableView表视图控件UICollectionView集合视图UIWebView或WKWebView网页视图XIB布局Common待分类第三方UILabel标签控件文字显示异常(AttributedTitle副转载 2017-08-17 22:28:36 · 849 阅读 · 0 评论