chenzhao

  • java
  • iOS
  • IT
知识积累
不积跬步无以至千里
iOS

ios 图库的使用

UIImagePickerControllerDelegate ,UINavigationControllerDelegate func actionSheet(actionSheet: UIActionSheet, clickedButtonAtIndex buttonIndex: Int){ PickerController = UIImagePickerController() if buttonIndex == 0{//图库 PickerController.sourceType = UIImagePick…

2016年 9月 12日 0条评论 166点热度 0人点赞 陈昭 阅读全文
iOS

swift画线

override func drawRect(rect: CGRect) { super.drawRect(rect) let context = UIGraphicsGetCurrentContext() CGContextSetLineCap(context,CGLineCap.Round)// CGContextSetLineWidth(context, 2)// 线宽 CGContextSetAllowsAntialiasing(context, true)// 锯齿 CGContextSetRGBStro…

2016年 9月 11日 0条评论 179点热度 0人点赞 陈昭 阅读全文
iOS

UIImage图片拉伸

```swift // 做到一个聊天背景图时 发现背景图片需要自动大小, 记录下图片拉伸的使用方法 // 参数的意思是从宽高的位置指向的一个像素的+1像素进行拉伸 (参数宽高 范围 是保护部分不会被拉伸) image = [image stretchableImageWithLeftCapWidth:image.size.width/2 topCapHeight:image.size.height/2]; ``` iOS中图片(UIImage)拉伸技巧 转: https://my.oschina.net/u/234…

2016年 9月 10日 0条评论 303点热度 0人点赞 陈昭 阅读全文
iOS

AutoLayout框架Masonry使用心得

转自 :http://www.starming.com/index.php?v=index&view=81 我们组分享会上分享了页面布局的一些写法,中途提到了AutoLayout,会后我决定将很久前挖的一个坑给填起来(还有好多坑就不说了,说了不填更毁形象了)。 可使用的框架首推Masonry,关于为啥选择Masonry看看官方文档就明白了https://github.com/SnapKit/Masonry,官方称AutoLayout所有功能Masonry都支持。这次项目界面方面我就全部使用了Masonry。…

2016年 9月 9日 0条评论 173点热度 0人点赞 陈昭 阅读全文
iOS

寻找上层的ViewController

extension UIView { func findController() -> UIViewController! { return self.findControllerWithClass(UIViewController.self) } func findNavigator() -> UINavigationController! { return self.findControllerWithClass(UINavigationController.self) } func findCon…

2016年 8月 30日 0条评论 158点热度 0人点赞 陈昭 阅读全文
iOS

webCookie 设置,自动登录

var param = "" if self.webUrl.rangeOfString("?") != nil{ param = "&random=\(random)" }else{ param = "?random=\(random)" } let webNSUrl = NSURL(string: (self.webUrl+param))! if (webNSUrl).host?.rangeOfString("che…

2016年 8月 30日 0条评论 168点热度 0人点赞 陈昭 阅读全文
iOS

获取APP的Launch Image

Tips:获取APP的Launch Image + (UIImage *)getLanchImage { CGSize viewSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, [[UIScreen mainScreen] bounds].size.height); NSString *viewOrientation = @"Portrait"; //横屏请设置成 @"Landscape" NSStrin…

2016年 8月 30日 0条评论 193点热度 0人点赞 陈昭 阅读全文
iOS

UICollectionViewFlowLayout最大间距设置

// // DanceTeamSearchLayout.swift // boosjdance // // Created by boosj on 16/8/29. // Copyright © 2016年 cz. All rights reserved. // //swift3 import UIKit /// 舞队 搜索记录的layout class DanceTeamSearchLayout: UICollectionViewFlowLayout { //我们想设置的最大间距,可根据需要改 //var max…

2016年 8月 29日 0条评论 175点热度 0人点赞 陈昭 阅读全文
iOS

设置文本的部分文本的颜色NSMutableAttributedString 样式文本

/** 设置需要的文本颜色 :param: text 需要设置颜色的文本 :returns: return NSMutableAttributedString */ func setTextColor(number:String)->NSMutableAttributedString{ let testNumber = (number as NSString).length let titlestr = "共\(number)个视频" var str = NSMutableAttribut…

2016年 8月 26日 0条评论 165点热度 0人点赞 陈昭 阅读全文
iOS

设置文本的部分文本的颜色NSMutableAttributedString 样式文本

/** 设置需要的文本颜色 :param: text 需要设置颜色的文本 :returns: return NSMutableAttributedString */ func setTextColor(number:String)->NSMutableAttributedString{ let testNumber = (number as NSString).length let titlestr = "共\(number)个视频" var str = NSMutableAttribut…

2016年 8月 26日 0条评论 176点热度 0人点赞 陈昭 阅读全文
1…2223242526

陈昭

IT 程序员

分类
  • iOS / 179篇
  • IT / 20篇
  • java / 35篇
  • 前端 / 13篇
  • 安卓 / 2篇
最近评论

COPYRIGHT © 2022 chenzhao. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang