04 2015 档案

摘要:1. 建一个 UIView的子类(MyView.h/MyView.m)2. 建一个 View类型的XIB3. 把xib的file‘s owner设为MyView4. 在.h文件里加上@property (nonatomic, retain) IBOutlet UIView *contentView;... 阅读全文
posted @ 2015-04-28 14:48 菜鸟程序猿 阅读(1233) 评论(0) 推荐(0)
摘要:转自:http://dadage456.blog.163.com/blog/static/303107442014911417527161、创建一个空白的UIViewController2、将UIScrollView添加到UIView控件中,并设置UIScrollView针对父视图UIView的co... 阅读全文
posted @ 2015-04-28 10:34 菜鸟程序猿 阅读(627) 评论(0) 推荐(0)
摘要:到Storyboard中,选择collection view controller中的"Collection View"。在Attributes inspector中,选择"Section Header"和"Section Footer",一旦选中你就会在屏幕中看到下面的的显示:最重要的是,我们必须... 阅读全文
posted @ 2015-04-24 11:06 菜鸟程序猿 阅读(2451) 评论(0) 推荐(0)
摘要:- (void)viewDidLoad { [super viewDidLoad]; NSDateComponents *fromDateComponents = [[NSDateComponents alloc]init]; NSDateComponents *toDat... 阅读全文
posted @ 2015-04-22 16:05 菜鸟程序猿 阅读(1310) 评论(0) 推荐(0)
摘要:设置View borderWidth/cornerRadius/borderColor为了兼容CALayer 的KVC ,你得给CALayer增加一个分类CALayer+BorderColor.h#import #import @interface CALayer (BorderColor)@pro... 阅读全文
posted @ 2015-04-14 16:55 菜鸟程序猿 阅读(554) 评论(0) 推荐(0)
摘要:/** * 指定Size压缩图片 (图片会压缩变形) * * @param image 原图 * @param size 压缩size * * @return 压缩后的图片 */-(UIImage*)OriginImage:(UIImage *)image scaleToSize:(CGS... 阅读全文
posted @ 2015-04-08 21:14 菜鸟程序猿 阅读(1683) 评论(0) 推荐(0)
摘要:xib 方式1.在Cell.h文件中加一个宏#define cellIdentifier @"customCell"2. ViewController中:- (void)viewDidLoad { [super viewDidLoad]; [_tableView registerNib:... 阅读全文
posted @ 2015-04-02 09:27 菜鸟程序猿 阅读(366) 评论(0) 推荐(0)