自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(19)
  • 资源 (1)
  • 收藏
  • 关注

原创 cocos2d-lua .csb文件动画播放

local root = cc.CSLoader:createNode("SecondLayer.csb")     layer:addChild(root)          self.sprite2 = root:getChildByName("Sprite_2")         local timeline = cc.CSLoader:createT...

2018-02-27 16:40:04 1208

原创 swift 点击imageView全屏预览(UIview中弹出提示框)

  @objc func didTap() {         print("浏览照片")         let image = self.chatImageView.image         let window = self.viewController().view         let backgroundView = UIView.init(...

2018-02-27 16:40:01 449

原创 swift get constraints with identifier

var c = webView.constraints.filter { $0.identifier == "webViewCons" }.first             c?.constant = ScreenSize.SCREEN_HEIGHT - 224

2018-02-27 16:39:58 216

原创 iOS——网络请求(原生)

新建继承Object类 类.h  typedef void (^SuccessBlock)(id responseObject); typedef void(^FailureBlock)(NSString *error); @interface 类 : NSObject + (void)getWithURL:(NSString *)url Params:(N...

2018-02-27 16:39:54 176

原创 在Mac新建cocos2dx-lua工程

1.下载好cocos2dx文件(准备:开发环境)。 2.在终端cd到该文件夹目录下,目录下setup.py文件,输入命令./setup.py;输入终端返回的信息''source /Users/电脑名/.bash_profile''这条命令并回车。 如果出现问题未成功,则在终端cd到下图bin目录下执行第三步操作             3.输入cocos ...

2018-02-27 16:39:50 433

原创 XML的解析方式

在iOS中提供了C接口的libxml2(DOM)和Objective-C(SAX)的NSXMLParser两种方式。 libxml2: libxml2是GNU的一个C语言的跨平台开源XML解析库,支持DOM和SAX方式解析,并且支持通过XPath方式便利DOM数查询数据。libxml2支持HTML解析。 使用libxml2需要先引入libxml2.dylib...

2018-02-27 16:39:45 132

原创 iOS——单例模式

单例类一般通过一个类方法获取这个唯一的对象  “单例模式”是我们在iOS中最常使用的设计模式之一。单例模式不需要传递任何参数,就有效地解决了不同代码间的数据共享问题。单例类是一个非常重要的概念,因为它们表现出了一种十分有用的设计模式。单例类的应用贯穿于整个iOS的SDK中。例如,UIApplication类有一个方法叫sharedApplication,从任何地方调用这个方法,都将返回与

2018-02-27 16:39:41 125

原创 iOS——类似QQsegment切换按钮

UISegmentedControl *segment = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"洗车订单",@"其他订单", nil]];     segment.layer.masksToBounds = YES;     segment.layer.cornerRadius = 15;

2018-02-27 16:39:36 328

原创 iOS——拍照后的照片保存到本地

UIImageWriteToSavedPhotosAlbum(image, self, nil, nil);

2018-02-27 16:39:33 1162

原创 iOS——字体,颜色,常量等适配机型

#define iPhone4S (HKHeight #define iPhone5 (HKHeight == 568.0) #define iPhone6 (HKHeight == 667.0) #define iPhone6PLUS (HKHeight == 736.0) #define HKGenericFont (iPhone5? DEFAULT_FONT(16) : (iPho

2018-02-27 16:39:30 527

原创 iOS——网络请求(Post&&Get)

/**  *  发送一个POST请求  *  *  @param url     请求路径  *  @param params  请求参数  *  @param success 请求成功的回调  *  @param failure 请求失败的回调  */ + (void)postWithURL:(NSString *)url params:(NSDictionary *)param

2018-02-27 16:39:27 323

原创 iOS——重写Cell分割线

+ (void)drawRect:(CGRect)rect {          CGContextRef context = UIGraphicsGetCurrentContext();     CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);     CGContextFillRect(cont

2018-02-27 16:39:23 170

原创 iOS——截屏

+(UIImage *)snapshot:(UIView *)view {     UIGraphicsBeginImageContextWithOptions(view.bounds.size,YES,0);          [view drawViewHierarchyInRect:view.bounds afterScreenUpdates:YES];          UII

2018-02-27 16:39:20 157

原创 iOS——json13位时间戳转换时间格式

(1).Since1970 +(NSString *)getNewDate:(NSString *)dateStr{     NSDate *date = [NSDate dateWithTimeIntervalSince1970:[dateStr doubleValue]/1000];     NSDateFormatter * formatter = [[NSDateFormatter

2018-02-27 16:39:17 450

原创 iOS——json数据解析

/**  *  字典转json  */ + (NSString*)dictionaryToJson:(id)dic {     NSError *parseError = nil;  NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted erro

2018-02-27 16:39:14 1804

原创 iOS——颜色转图片

+(UIImage *)imageWithUIColor:(UIColor *)color{     CGRect rect=CGRectMake(0.0f, 0.0f, 55.f, 1.f);     UIGraphicsBeginImageContext(rect.size);     CGContextRef context = UIGraphicsGetCurrentContext(

2018-02-27 16:39:11 520

原创 iOS——实现调用拨打电话

NSMutableString * str=[[NSMutableString alloc] initWithFormat:@"tel:%@",@"183********"];     UIWebView * callWebview = [[UIWebView alloc] init];     [callWebview loadRequest:[NSURLRequest requestWit

2018-02-27 16:39:08 1097

原创 Swift4 UILabel AttributedString 检索字符串分段改变颜色

String扩展类方法func nsRange(from range: Range) -> NSRange? { let utf16view = self.utf16    if let from = range.lowerBound.samePosition(in: utf16view), let to = range.upperBound.samePosition(in

2018-01-26 17:01:31 2042

原创 iOS——给View add阴影效果

话不多说,上代码。  任何继承自UIView的空间都是有layer这个属性的。(header 是一个控件)UIBezierPath *shadowPath = [UIBezierPath bezierPathWithRect:header.bounds];    header.layer.masksToBounds = NO;    header.layer.sha

2017-06-05 11:05:08 173

ios核心动画高级技巧

ios核心动画高级技巧 Core Animation其实是一个令人误解的命名。你可能认为它只是用来做动画的,但实际上它是从一个叫做Layer Kit这么一个不怎么和动画有关的名字演变而来,所以做动画这只是Core Animation特性的冰山一 角。Core Animation是一个复合引擎,它的职责就是尽可能快地组合屏幕上不同的可视内容,这个内容是被分解成独立的图层,存储在一个叫做图层树的体系之中。于是这个树形成了UIKit以及在iOS应用程序当中你所能在屏幕上看见的一切的基础。

2017-09-15

空空如也

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

TA关注的人

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