摘要: iOS textField禁止输入指定字母(如:禁止输入a、b、A、B)1、定义宏#define NUMBERS @"aAbB"2、textfield—delegate- (BOOL)textField:(UITextField*)textField shouldChangeCharactersIn... 阅读全文
posted @ 2016-01-20 10:34 tongyuling 阅读(860) 评论(0) 推荐(0) 编辑
摘要: 问题:分割线没有显示全,左边有一段缺失解决:-(void)viewDidLayoutSubviews { if ([self.tableView respondsToSelector:@selector(setSeparatorInset:)]) { [self.tableView setS... 阅读全文
posted @ 2016-01-08 15:54 tongyuling 阅读(661) 评论(0) 推荐(0) 编辑
摘要: 让textField光标让右移动10个像素位置:UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 40)];self.textField.leftView = view;self.textField.leftView... 阅读全文
posted @ 2015-11-26 16:15 tongyuling 阅读(1571) 评论(0) 推荐(0) 编辑
摘要: tableView继承自scrollView,所以tableView和scrollView在同一界面中都会走delegate方法。那么有时滑动tableView,scrollView会响应怎么解决?其实很简单:在delegate里面判断self.scrollview==scrollView或self... 阅读全文
posted @ 2015-11-23 16:18 tongyuling 阅读(1873) 评论(0) 推荐(0) 编辑
摘要: NSAssert的使用苹果在foundation.framework中定义了这么一个宏:#define NSAssert(condition, desc, ...)第一个参数为一个条件判断,如果为假,则抛出异常,显示第二个参数所描述的信息。例如NSAssert(1>=2, @"1>=2 is fal... 阅读全文
posted @ 2015-11-18 10:24 tongyuling 阅读(335) 评论(0) 推荐(0) 编辑
摘要: LaunchImage在APP初始化完之后会立即消失并显示APP的界面,但是有的时候我们不希望它这么快就消失(比如有的人希望有个过渡效果 有的人希望等某些设置或者数据加载完之后再消失),这也很简单,我们只要自己把LaunchImage再显示出来并且置顶就OK了。不过我们配置了那么多适用于不同屏幕分辨... 阅读全文
posted @ 2015-10-30 15:14 tongyuling 阅读(1584) 评论(0) 推荐(0) 编辑
摘要: 实现Quick Actions有两种办法: 静态、动态静态:动态: 阅读全文
posted @ 2015-10-28 15:34 tongyuling 阅读(146) 评论(0) 推荐(0) 编辑
摘要: //系统表情替换+ (NSString *)stringReplaceWithFace:(NSString *)str{ NSString *mutaStr = str; for (int i=0x1F600; i 0x1F644) { int sym = EMOJI_CODE_TO... 阅读全文
posted @ 2015-10-27 17:31 tongyuling 阅读(1758) 评论(0) 推荐(0) 编辑
摘要: iOS 设置UILabel 的内边距- (void)drawTextInRect:(CGRect)rect { UIEdgeInsets insets = {0, 5, 0, 5}; [super drawTextInRect:UIEdgeInsetsInsetRect(rect, in... 阅读全文
posted @ 2015-10-26 17:23 tongyuling 阅读(5133) 评论(0) 推荐(1) 编辑
摘要: //长按是否出现编辑菜单(Cut Copy Paste)- (BOOL)collectionView:(UICollectionView *)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath *)indexPath{ retu... 阅读全文
posted @ 2015-10-16 16:07 tongyuling 阅读(660) 评论(0) 推荐(0) 编辑