事先准备一张图片: UIImage *image = [UIImage imageNamed:@"red.png"]; 在iOS 5.0之前能够这么用: NSInteger leftCapWidth = image.size.width * 0.5f; NSInteger topCapHeight ...
分类:
移动开发 时间:
2017-06-13 19:47:10
阅读次数:
348
UIView设置圆角 1、比较简单的情况,UIView四个角都是圆角: UIView *aView = [[UIView alloc] init]; aView.frame = CGRectMake(0, 0, 300, 200); aView.backgroundColor = [UIColor ...
分类:
移动开发 时间:
2017-06-12 19:53:28
阅读次数:
202
需求描述: 有两个ViewController 我们记做 A、B ,其中B controller只是显示下半部分; 如下图效果: 实现这种的方案很多,可以用添加View方法, 也可以用UIWindows 来实现。 但是我这边是想用presentViewController 实现,但是A presen ...
分类:
移动开发 时间:
2017-06-12 12:58:26
阅读次数:
284
这个 UIImage 的一个叫 MultiFormat 的分类,看名字可能已经猜到,UIImage 的多版本,主要功能是用来做 NSData 和 UIImage 的相互转化的。 .h 定义了 3 个方法,基本只是看方法名和返回值,已经基本猜到各个方法要实现的功能。 1.这是一个类方法,一个NSDat ...
分类:
Web程序 时间:
2017-06-10 13:54:47
阅读次数:
260
一行代码巧妙实现iOS返回button: self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"back"] imageWithRenderingMod ...
分类:
移动开发 时间:
2017-06-09 09:54:13
阅读次数:
181
iOS开发 - ANPs推送通知 iOS开发 - ANPs推送通知 标签: 推送通知ANPs远程推送本地推送 2015-05-03 14:12 3510人阅读 评论(0) 收藏 举报 标签: 推送通知ANPs远程推送本地推送 2015-05-03 14:12 3510人阅读 评论(0) 收藏 举报 ...
分类:
移动开发 时间:
2017-06-07 14:31:48
阅读次数:
263
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section { view.tintColor = [UIColor clearColor]; ...
分类:
其他好文 时间:
2017-06-06 14:26:21
阅读次数:
246
1. https://stackoverflow.com/questions/11751883/how-can-i-reduce-the-file-size-of-a-video-created-with-uiimagepickercontroller http://www.jianshu.com/ ...
分类:
其他好文 时间:
2017-06-05 19:54:31
阅读次数:
147
import UIKit class ViewController3: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.view.backgroundColor=UIColor.whiteColor( ...
分类:
编程语言 时间:
2017-06-05 11:33:46
阅读次数:
194
UI给开发的效果图非常多时候标注着十六进制的Color,而程序中用到的往往是UIColor能够用例如以下方法去转换:(UIColor *)RGBColorFromHexString:(NSString *)color alpha:(float)alpha { //color的值相似#fffeee,a ...
分类:
移动开发 时间:
2017-06-04 22:42:16
阅读次数:
173