- 博客(10)
- 收藏
- 关注
原创 HMSegmentedControl的使用
下载地址:https://github.com/HeshamMegid/HMSegmentedControl HMSegmentedControl *segmented = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"已收公告",@"已发公告"]]; segmented.autoresizingMas
2016-05-27 14:14:57 8758 1
转载 ayoutSubviews layoutIfNeeded setNeedsLayout 的区别
layoutSubviewslayoutIfNeededsetNeedsLayoutsetNeedsDisplaydrawRectsizeThatFits sizeToFit layoutSubviews 这个方法,默认没有做任何事情,需要子类进行重写 。 系统在很多时候会去调用这个方法: 1.初始化不会触发layoutSubviews,但是如果设置了不为CGRectZ
2016-05-25 17:10:34 671
原创 UIWebView加载本地html
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight-64)]; webView.backgroundColor=YYCToothWashViewBgColor; [self.view addSubview:webView]
2016-05-19 11:53:00 280
转载 OC单例模式
概念 单例模式是一种常用的软件设计模式。在它的核心结构中只包含一个被称为单例的特殊类。通过单例模式可以保证系统中一个类只有一个实例而且该实例易于外界访问,从而方便对实例个数的控制并节约系统资源。如果希望在系统中某个类的对象只能存在一个,单例模式是最好的解决方案。 书写步骤 创建类方法,返回对象实例.以shared,default,current开头。创建一个全局变量用来保存对象的
2016-05-19 11:05:59 289
原创 iOS 邮箱、手机号、身份证....正则表达式
//邮箱 + (BOOL) validateEmail:(NSString *)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithForma
2016-04-25 16:38:47 339
原创 ios与js交互,获取webview完整url,title,获取元素并赋值跳转
document:属性 document.title //设置文档标题等价于HTML的标签 document.bgColor //设置页面背景色 document.fgColor //设置前景色(文本颜色) document.linkColor //未点击过的链接颜色 docu
2016-04-25 12:01:09 336
转载 关闭APP后cookie失效的解决方法
第一步 NSHTTPCookieStorage *myCookie = [NSHTTPCookieStorage sharedHTTPCookieStorage]; for (NSHTTPCookie *cookie in [myCookie cookies]) { NSLog(@"
2016-04-25 11:57:31 932
原创 防止Navigation 重复点击push下一界面
写了一个navigation基类,重写了push方法:传进来要push的控制器,然后判断该控制器是否已经压入栈顶 - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { if (![[super topViewController] isKindOfClass:[vi
2016-04-25 11:51:15 750
原创 多线程的种类
1.Thread; 2, Cocoa operations; 3, Grand Central Dispatch (GCD) (iOS4 才开始支持) 下面简要说明这三种不同范式: Thread 是这三种范式里面相对轻量级的,但也是使用起来最负责的,你需要自己管理thread的生命周期,线程之间的同步。线程共享同一应用程序的部分内存空间,它们拥有对数据相同的访问权限。你得协调多个线程对
2015-06-08 17:12:17 269
原创 UIButtonAndUITextField
UIButton: 在设置属性的时候需要注意,UIButton中默认有 @property(nonatomic,readonly,retain) UILabel *titleLabel; (在UIButton不能创建titleLable属性) @property(nonatomic,readonly,retain) UIImageView *imageView; @proper
2015-01-25 19:59:05 234
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人