自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(137)
  • 收藏
  • 关注

转载 UICollectionViewCell间距

CalenderCollectionViewFlowLayout *flowLayout = [[CalenderCollectionViewFlowLayout alloc] init]; flowLayout.minimumLineSpacing = 0; flowLayout.minimumInteritemSpacing = 0; flowLa...

2017-11-09 10:46:00 108

转载 1 - 熟悉ES6语法

1、使用CommonJS标准,引入React包基本通过require进行import React, { Component, PropTypes,} from 'react';import { Image, Text} from 'react-native'注意在React Native里,import直到0.12+才能正...

2017-01-18 11:14:00 170

转载 基于baseview中多个子viewcontroll切换

//// BaseVC.m// SmsSessions//// Created by Ken on 16/6/24.// Copyright © 2016年 ken. All rights reserved.//#import "BaseVC.h"@interface BaseVC (){ UIView *curView;...

2016-06-24 16:39:00 135

转载 sdwebimage

- (void)webDataManager:(SDWebDataManager *)dataManager didFinishWithData:(NSData *)aData isCache:(BOOL)isCache{ UIImage *img=[UIImage imageWithData:aData]; if(aData.length == 791...

2016-05-30 17:32:00 90

转载 pods安装使用

sudo gem install cocoapods如果执行没有反应,应该是墙。2、使用淘宝镜像去安装$ gem sources --remove https://rubygems.org/   //移除自带的镜像$ gem sources -a http://ruby.taobao.org/3、完成后查看gem sources -l...

2016-01-14 11:12:00 65

转载 TableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { ...

2016-01-05 19:17:00 63

转载 UILable字体颜色控制

NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"系统详细的使用手册,请点击查看【移动监管用户手册】"]; [str addAttribute:NSForegroundColorAttributeName value:[UIColor redC...

2015-12-10 14:21:00 69

转载 使用React Navtive框架准备工作

1,首先mac安装Homebrew,当然也可以直接在终端中执行http://brew.sh/可以在这里找到下面该连接ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"  安装成功之后,然后用brew命令来安装Node.js然...

2015-10-12 18:22:00 101

转载 ios9 jsonkit

升级到iOS9之后,使用XCode7编译时,发现JSONKit不幸的又出现问题了,那么如何解决呢?解决方案1:等待JSONKit更新,同时等待所有使用JSONKit的第三方SDK更新(好吧这方法是逗你玩的)解决方案2:使用系统的!!但是使用系统JSON解析很麻烦,项目改动又比较多,怎么办?这时候可以试试我之前写的小库,完美兼容JSONKit的常用方法,并且采用系...

2015-10-10 17:23:00 82

转载 根据坐标过去颜色

- (UIColor *) colorOfPoint:(CGPoint)point{ unsigned char pixel[4] = {0}; CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreat...

2015-08-07 13:42:00 91

转载 UIButton中内容大小,以及UITextFiled改变和选中

//按钮的内在内容大小随着按钮名称变化而变化 UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom]; [btn1 setTitle:@"Hello World" forState:UIControlStateNormal]; NSLog(@"%@ : %@",[btn1 tit...

2015-04-30 12:27:00 114

转载 快速排序GCD

m_mutArrGrade = [[NSMutableArray alloc]init]; m_mutArrGrade = [NSMutableArray arrayWithArray:m_arrStore]; NSComparator finderSort = ^(id string1,id string2){ StoreI...

2015-04-03 09:54:00 90

转载 A-生成Button,绑定事件和图片

- (UIButton*)buildButton:(CGRect)frame normalImgStr:(NSString*)normalImgStr highlightImgStr:(NSString*)highlightImgStr selectedImgStr:(NSString*)selectedImgStr...

2015-03-20 15:36:00 445

转载 3 - JSBinding进阶

在JS与OC进行交互的时候特别要注意内存问题。当JS与OC存在循环引用的时候,那么势必在成内存的叠加无法释放。所以合理的使用JS中var girl = new Girl();girl.boyFriend = boy;boy.girlFriend = girl;  OC中JSManagedValue包装了一次,系统会正确引用释放-(voi...

2015-01-30 17:41:00 115

转载 2 - JSBinding Call Native Code via Block

#import <JavaScriptCore/JavaScriptCore.h>之前一章已经看过JS和Block的互动NSInteger nNumber = 9; NSString *strOut = @"abc"; context[@"sum"] = ^(int a,int b) { NSLog(@"str...

2015-01-28 17:36:00 81

转载 1-初识 JSBinding

首先我们先认识JSBindingJSBinding本身并非Hybrid,本质上也并无任何联系。JSBinding实际是JS 与 Native 间的一座桥梁,通过JS引擎进行交互。Hybrid实际是Web 与 Native间的一座桥梁,还是通过Web中,实际应用中仍然是WebView。原生语言特点 :1、高性能 2、更底层 更强大 3、平台特性动态脚本语言...

2015-01-28 16:13:00 278

转载 GCD多线程

点击一个按钮,然后显示loading,同时在后台下载一张图片,最后将下载的图片放到UIImageView中显示为例。 1 //显示loading 2 self.indicator.hidden = NO; 3 [self.indicator startAnimating]; 4 //进入异步线程 5 dispatch_...

2014-11-18 10:10:00 47

转载 UILable多行,识别\n\t

//识别\n\t多行 1 -(void) theViewInTheLableToRefresh 2 { 3 UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 310, 1)]; 4 lab.text = m_strContentText; 5 lab.numberO...

2014-11-03 14:44:00 113

转载 app 使用html5的优缺点

HTML5是用于取代1999年所制定的 HTML 4.01 和 XHTML 1.0的标准通用标记语言。是新一代的支持移动互联网网页开发技术。HTML5拥有良好的页面表现性能和跨平台兼容性。  HTML5它的开发是通过谷歌、苹果,诺基亚、中国移动等几百家公司一起酝酿的技术,这个技术最大的好处在于它是一个公开的技术。是现实的网络标准,这意味着它将大大降低用户的开发成本和跨平台兼容性。比如...

2014-09-03 13:25:00 125

转载 swift使用函数、闭包、枚举

定义函数(参数name,day类型string,返回值->String)func greet(name: String, day: String) -> String { return "Hello \(name), today is \(day)."}greet("Bob", "Tuesday")func getGasPrices() -> (Do...

2014-06-04 16:54:00 64

转载 swift 基础

一、简单类型println("say goodbey")    //无需添加”;“ ,也不用java,c等添加main{}函数let strName = 1024;     //定义常亮,一次定义多次使用,#default kXXX 45类似var strPhoneNumber = "hehe";  //定义变量,系统会自动识别你的类型let strName :Doub...

2014-06-04 16:52:00 49

转载 ios state bar 隐藏

[UIApplicationsharedApplication].statusBarHidden = YES; if ([UIApplicationsharedApplication].statusBarHidden == NO) { //iOS7,需要plist里设置 View controller-based status bar appeara...

2014-05-22 16:20:00 93

转载 GPUIImage

#import "GLProgram.h"// Base classes#import "GPUImageOpenGLESContext.h"#import "GPUImageOutput.h"#import "GPUImageView.h"#import "GPUImageVideoCamera.h"#import "GPUImageStillCamera....

2014-05-05 15:37:00 85

转载 iOS- 模型映射

+ (StoreInfo *)parseEntityWithDictionary:(NSDictionary *)arributeDict{ StoreInfo * instance = [[StoreInfo alloc] init]; for(int i = 0 ; i < [arributeDict count] ; i++) { ...

2014-03-31 18:12:00 126

转载 CoreAnimation之CALayer细说

首先CGImageRef与UIImage相互转换//CGImageRef转换成UIImage CGImageRef iOffscreen = CGBitmapContextCreateImage(context);UIImage* image = [UIImage imageWithCGImage: iOffscreen]; //UIImage转换成C...

2014-02-12 11:24:00 66

转载 测试NSURL,http请求的代理函数

#import <UIKit/UIKit.h>#import "ShowHelloViewController.h"@interface AppDelegate : UIResponder <UIApplicationDelegate>{ NSString *m_strTest;}@property (strong, no...

2014-02-10 17:16:00 86

转载 ios 判断整形,浮点型

判断整形- (BOOL)isPureInt:(NSString *)string{  NSScanner* scan = [NSScanner scannerWithString:string];   int val;   return [scan scanInt:&val] && [scan isAtEnd];}  判...

2014-01-22 14:30:00 118

转载 ios 监听home键

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:)name:UIApplicationWillResignActiveNotification object:nil]; //监听是否触发home键挂起程序. [[...

2014-01-21 14:13:00 161

转载 [ UIApplication sharedApplication] 使用

[[UIApplication sharedApplication] setIdleTimerDisabled:YES]; 保持常量转载于:https://www.cnblogs.com/zcw-ios/articles/3522100.html

2014-01-16 10:50:00 149

转载 navigation 设置自定义title

首先自定义view+ (UIView *) changeViewTitleFontSize:(NSString *)strTitle;{ //自定义标题 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0 , 100, 44)]; titleLabel.back...

2014-01-08 11:11:00 162

转载 使用UIGestureRecognizerDelegate,识别单击事件

首先.h文件添加UIGestureRecognizerDelegate //长按设置情景模式 UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressShowV...

2014-01-07 17:35:00 105

转载 跳转模态视图兼容ios4.3(NSClassFromString)

跳转模态视图兼容ios5,ios4.3- (void)setWirless{ ConfigureWirelessViewController *vcConfigureWireless = [[ConfigureWirelessViewController alloc] init]; vcConfigureWireless.m_delegateConfigu...

2014-01-07 10:36:00 70

转载 UIImage拉伸

UIImage *img = [UIImage imageNamed:@"write_operation_bg.png"];UIImage *imgNew = [img stretchableImageWithLeftCapWidth:20 topCapHeight:20];宽高拉伸20像素转载于:https://www.cnblogs.com/zcw-ios/a...

2014-01-06 11:12:00 63

转载 控制播放声音(音量调节)

//.h,导入,并添加delegate#import <MediaPlayer/MediaPlayer.h>RBDMuteSwitchDelegate//.m//检测当前是否为静音[[RBDMuteSwitch sharedInstance] setDelegate:self];[[RBDMuteSwitch sharedInstance]...

2013-12-23 16:53:00 328

转载 控制iphone/ipad锁屏(阻止锁屏)

[[UIApplication sharedApplication] setIdleTimerDisabled: YES];或者[UIApplication sharedApplication].idleTimerDisabled = YES;这样可以有效的控制不允许锁屏,点赞~~转载于:https://www.cnblogs.com/zcw-ios/ar...

2013-12-17 10:35:00 214

转载 ios UIView常用动画效果

一//调用if(m_viewScenario.superview == nil){ m_viewScenario.alpha = 1.0; m_viewScenario.transform = CGAffineTransformIdentity; [self zoomIn:m_viewScenario andAnimationDuration:1...

2013-12-09 16:04:00 46

转载 ios 正则表达式帅选

正则表达式获取标签内容 NSString *zz = @".*<record_config([^>].*?)/>.*";// NSString *string2 = @"PHA+YXNkPC9wPjxyZWNvcmRfY29uZmlnDQp0cmlnZ2VyX21vZGU9IjAiIHJlY29yZGluZ19tb2RlPSIwIiBlbmFib...

2013-12-09 10:31:00 43

转载 NSDate获取一个月后的一天

NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = nil; comps = [calendar components:NSYearCalendarUnit|NSMonthC...

2013-12-07 21:59:00 126

转载 ios 异常捕获发送

1,- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions下添加 //安装异常捕获#ifdef DEBUG [NSThread detachNewThreadSelector:@selector(st...

2013-12-06 15:34:00 52

转载 ios 线程使用

NSThread 有两种直接创建方式:- (id)initWithTarget:(id)targetselector:(SEL)selectorobject:(id)argument+ (void)detachNewThreadSelector:(SEL)aSelectortoTarget:(id)aTargetwithObject:(id)anArgument...

2013-12-05 19:04:00 57

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除