UISlide属性 1.   minimumValue  : 当值可以改变时,滑块可以滑动到最小位置的值,默认为0.0 _slider.minimumValue = 10.0; 2.   maximumValue : 当值可以改变时,滑块可以滑动到最大位置的值,默认为1.0 _slider.maximumValue = 100.0; 3.   continuous : 如果设置YES,在拖动滑块的任何时候,滑块的值都会改变.默认设置为YES [_slider setContinuous:NO];…
1.+(BOOL)isSourceTypeAvailable:(UIImagePickerControllerSourceType)sourceType;         // 检查指定源是否在设备上可用. [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary];  //检查照片源是否可用 2.allowsEditing 默认NO 是否允许编辑 [imagePick…
UITableView UITableView内置了两种样式:UITableViewStylePlain,UITableViewStyleGrouped   <UITableViewDataSource,UITableViewDelegate>里的方法: tableView处理步骤 1.有多少组 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 2.第section组头部控件有多高 - (CGFloat)tabl…
UIView 1.alpha 设置视图的透明度.默认为1. // 完全透明 view.alpha = 0; // 不透明 view.alpha = 1; 2.clipsToBounds // 默认是NO,当设置为yes时,超出当前视图的尺寸的内容和子视图不会显示. view.clipsToBounds = YES; 3.hidden // 默认是NO,当设置为yes,视图就看不见了. view.hidden = YES; 4.userInteractionEnabled // 默认为YES,如果…
UITextField属性 0.     enablesReturnKeyAutomatically 默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. 1.borderStyle 设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITe…
UILabel属性 1.text:设置标签显示文本. label.text = @"我是Label"; 2.attributedText:设置标签属性文本. NSString *text = @"first"; NSMutableAttributedString *textLabelStr = [[NSMutableAttributedString alloc] initWithString:text]; [textLabelStr setAttributes:@{…
1.   numberOfComponents:返回UIPickerView当前的列数 NSInteger num = _pickerView.numberOfComponents; NSLog( @"%d", num); 2. - (NSInteger)numberOfRowsInComponent:(NSInteger)component; 返回component列中有多少行. NSInteger numInCp = [_pickerView numberOfRowsInCompo…
UIScrollView 1.   contentOffset 默认CGPointZero,用来设置scrollView的滚动偏移量. // 设置scrollView的滚动偏移量 scrollView.contentOffset = CGPointMake(0, 200); 2.   contentSize 默认CGSizeZero,用来设置scrollView的滚动范围. // 设置scrollView的滚动范围 scrollView.contentSize = CGSizeMake( sel…
UIPageControl 1.   numberOfPages // 设置有多少页 默认为0 [pageControl setNumberOfPages:kImageCount]; 2.   currentPage  // 设置当前页 [pageControl setCurrentPage:0]; 3.   pageIndicatorTintColor // 设置页码指示器颜色 [pageControl setPageIndicatorTintColor:[UIColor blackColor…
UISegment属性 1.segmentedControlStyle 设置segment的显示样式. typedef NS_ENUM(NSInteger, UISegmentedControlStyle) { UISegmentedControlStylePlain,     // large plain 系统默认平板样式 segmentedControl.segmentedControlStyle = UISegmentedControlStylePlain; UISegmentedCont…
UIAlertView 1.Title 获取或设置UIAlertView上的标题. 2.Message 获取或设置UIAlertView上的消息 UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确…
UIActivityIndicatorView 1.   activityIndicatorViewStyle 设置指示器的样式 UIActivityIndicatorViewStyleWhiteLarge UIActivityIndicatorViewStyleWhite  (默认样式) UIActivityIndicatorViewStyleGray 2.hidesWhenStopped 当停止动画的时候,是否隐藏.默认为YES. 3. 实例化指示器对象,根据样式设置尺寸,不需要手动设置.…
UISwitch属性 1. onTintColor 处于on时switch 的颜色     switchImage.onTintColor = [UIColor grayColor]; 2.tintColor 处于off时switch 的颜色 switchImage.tintColor = [UIColor greenColor]; 3.onImage 设置on 的图标     switchImage.onImage = [UIImage imageNamed:@"1.png"]; 4…
UIButton属性 1.UIButton状态: UIControlStateNormal          // 正常状态    UIControlStateHighlighted     // 高亮状态    UIControlStateDisabled        // 禁用状态     UIControlStateSelected        // 选中状态     UIControlStateApplication     //      UIControlStateReserve…
给iOS开发新手送点福利,简述文本属性Attributes的用法   文本属性Attributes 1.NSKernAttributeName: @10 调整字句 kerning 字句调整 2.NSFontAttributeName : [UIFont systemFontOfSize:_fontSize] 设置字体 3.NSForegroundColorAttributeName :[UIColor redColor] 设置文字颜色 4.NSParagraphStyleAttributeNam…
1.Locale 设置DatePicker的地区,即设置DatePicker显示的语言. 1.跟踪所有可用的地区,取出想要的地区 NSLog(@"%@", [NSLocale availableLocaleIdentifiers]); 2. 设置日期选择控件的地区 [datePicker setLocale:[[NSLocale alloc]initWithLocaleIdentifier:@"zh_Hans_CN"]]; 效果: [datePicker setLo…
UIControl事件 1.UIControlEventTouchDown 单点触摸按下事件:用户点触屏幕,或者又有新手指落下的时候. 2.UIControlEventTouchDownRepeat 多点触摸按下事件,点触计数大于1:用户按下第二.三.或第四根手指的时候. 3.UIControlEventTouchDragInside 当一次触摸在控件窗口内拖动时. 4.UIControlEventTouchDragOutside 当一次触摸在控件窗口之外拖动时. 5.UIControlEven…
直接上代码,里面有各种属性的用法注释,至于每个属性有多个可以设置的值,每个值的效果如何,可以通过查看这个函数参数的枚举量,并逐一测试. //制作登陆界面 #import "ViewController.h" @interface ViewController (){ //定义全局变量(控件) UITextField *username; UITextField *password; UIButton *resignbutton; UIButton *loginbutton; int i…
1.推送过程简介 (1)App启动过程中,使用UIApplication::registerForRemoteNotificationTypes函数与苹果的APNS服务器通信,发出注册远程推送的申请.若注册成功,回调函数application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 会被触发,App可以得到deviceToken,该tok…
OC语法入门(一) 数据类型和运算符 1.1凝视 凝视和其它语言一样,同意单行 ,多行凝视,一份规范的代码里面须要有一些正式的凝视,例如以下凝视: /* 这是多行 凝视 */ //这是多行凝视 OC语言临时不支持嵌套凝视.(swift里面支持这一特性) 1.2标示符和变量 1.2.1分隔符  1.分号 每个句子以分号结尾,一行能够多个语句,一个语句也能够跨多行.可是变量名不能分开    合法的:  NSString *name  = @"你好"; int age  = 20;  NSS…
(最近准备考试……空闲截图整理成博客)…
UITextField是IOS中非常常用的一个控件,用来接收用户输入信息,完成应用和用户的交互.它的主要属性设置如下: //初始化textfield并设置位置及大小 UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(, , , )]; //设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITex…
1. Block的声明和线程安全 Block属性的声明,首先需要用copy修饰符,因为只有copy后的Block才会在堆中,栈中的Block的生命周期是和栈绑定的,可以参考之前的文章(iOS: 非ARC下返回Block). 另一个需要注意的问题是关于线程安全,在声明Block属性时需要确认“在调用Block时另一个线程有没有可能去修改Block?”这个问题,如果确定不会有这种情况发生的话,那么Block属性声明可以用nonatomic.如果不肯定的话(通常情况是这样的),那么你首先需要声明Blo…
自定义NSOperation 一.实现一个简单的tableView显示效果 实现效果展示: 代码示例(使用以前在主控制器中进行业务处理的方式) 1.新建一个项目,让控制器继承自UITableViewController. 1 // 2 // YYViewController.h 3 // 01-自定义Operation 4 // 5 // Created by apple on 14-6-26. 6 // Copyright (c) 2014年 itcase. All rights reserv…
带属性的字符串: NSString *aa = @"hellochinaIloveYou!"; NSMutableAttributedString *mas = [[NSMutableAttributedString alloc]initWithString:aa]; // 设置字符串字属性 UIFont *font = [UIFont fontWithName:@"Arial" size:35.0f]; [mas addAttribute:NSFontAttrib…
图层 每个控件都有自己的一个图层,这个空间的全部东西就是显示在这个图层上面的,控件本身没有显示东西的功能,仅仅有拥有了图层才干显示东西 图层的获取 CALayer *layer = self.testView.layer; 使用UIView的图层为例 UIView本身仅仅有一个图层,主图层 self.testView.layer.borderWidth = 10;//设置边框大小 self.testView.layer.borderColor = [UIColor blueColor].CGCo…
http://blog.csdn.net/yixiangboy/article/details/50662704 一.案例演示 最近有一个小需求,就是要做一个圆形进度条,大概样子如下: . 在不知道有CAShapeLayer的strokeStart和strokeEnd属性的时候,我采取的方法就是实时的 移除旧的CAShapeLayer 然后重绘这个圆形的CAShapeLayer.显然这种方式的效率是不高的.后来在一次看别人Demo的时候,发现别人使用了CAShapeLayer的strokeSta…
0.     enablesReturnKeyAutomatically 默认为No,如果设置为Yes,文本框中没有输入任何字符的话,右下角的返回按钮是disabled的. 1.borderStyle 设置边框样式,只有设置了才会显示边框样式 text.borderStyle = UITextBorderStyleRoundedRect; typedef enum { UITextBorderStyleNone, UITextBorderStyleLine, UITextBorderStyleB…
contentOffset 默认CGPointZero,用来设置scrollView的滚动偏移量.       // 设置scrollView的滚动偏移量       scrollView.contentOffset = CGPointMake(0, 200);   2.   contentSize 默认CGSizeZero,用来设置scrollView的滚动范围.       // 设置scrollView的滚动范围       scrollView.contentSize = CGSizeM…
原文网址:http://www.zhihu.com/question/20264108 iOS 开发怎么入门? 请问有设计模式.内存管理方面的资料吗?最好有除了官方文档之外的其它内容,10 条评论 分享 按投票排序按时间排序92 个回答 543赞同反对,不会显示你的姓名郝健宗,曾经的注册会计师,如今鹅厂iOS工程师唐鑫敏.Marcel Ning.Evasto 等人赞同------- 2015年7月22日更新 ------刚开始做程序员的时候,曾经把自己自学iOS开发的一点经验写在这里分享.不知不…