<iOS小技巧> 昵称格式判断】的更多相关文章

一.使用方式 + 如下代码块功能:判断字体,判断字体输入格式       NSString *firstStr = [name substringToIndex:1];    NSArray *num = @[@"0",@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9"]…
原文链接 在这里总结一些iOS开发中的小技巧,能大大方便我们的开发,持续更新. UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0.1)]; self.tableView.tableHeaderView = view; UITableView的plain样式下,取消区头停滞效果 - (void)scrollViewDidScroll:(…
图片上绘制文字 写一个UIImage的category NSMutableParagraphStyle* paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; paragraphStyle.lineBreakMode = NSLineBreakByCharWrapping; paragraphStyle.alignment=NSTextAlignmentCenter;//文字居中 //计算文字所占的siz…
UITableView的Group样式下顶部空白处理 //分组列表头部空白处理 UIView *view = [[UIView alloc] initWithFrame:CGRectMake(, , , 0.1)]; self.tableView.tableHeaderView = view; UITableView的plain样式下,取消区头停滞效果 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat section…
前言 因为本人也是学习iOS才一个多月,在写程序的过程中经常会遇到一些看似应该很简单,但是要解决好却要知道一点小trick的问题. 因此后面会陆续记一些这类问题,一来加深印象,二来也可以做个备忘录. 正文 先介绍一下工作环境,目前使用的是xcode 6,SKD版本8.1. UITableView相信是大家最常用的控件,有一次在实现一个页面时,设计要求是表格分割线是和屏幕等宽的.但是目前的默认的表格分割线和屏幕左端是有一段距离的,如下图: 第一反应肯定是去看表格的属性列表,看看有什么可以设置的,还…
http://www.cocoachina.com/ios/20150911/13260.html 作者:uxyheaven 授权本站转载. 什么是这个问题 我们的按钮是点击一次响应一次, 即使频繁的点击也不会出问题, 可是某些场景下还偏偏就是会出问题. 通常是如何解决 我们通常会在按钮点击的时候设置这个按钮不可点击. 等待0.xS的延时后,在设置回来; 或者在操作结束的时候设置可以点击. 1 2 3 4 5 6 - (IBAction)clickBtn1:(UIbutton *)sender…
将颜色合成图片 将颜色合成图片 +(UIImage *)imageWithColor:(UIColor *)color { CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithColor(context, [col…
这段代码是实现了类似QQ空间"我的空间"里面的圆形头像 //圆形的头像 UIImageView * headImage = [[UIImageView alloc]initWithFrame:CGRectMake(, , , )]; headImage.backgroundColor = [UIColor grayColor]; headImage.image = [UIImage imageNamed:@"headimage.jpg"]; headImage.cl…
键盘透明: textField.keyboardAppearance = UIKeyboardAppearanceAlert; 状态栏的网络活动风火轮是否旋转: [UIApplication sharedApplication].networkActivityIndicatorVisible , 默认值是 NO . .截取屏幕图片: // 创建一个基于位 图的图形上下文并指定大小为CGSizeMake(200,400) UIGraphicsBeginImageContext(CGSizeMake…
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; //添加特殊命名空间 using System.Runtime.InteropServices; namespace GPS解析上位…