- 博客(96)
- 收藏
- 关注
转载 无限轮播图的实现
平时APP中的广告位、或者滚动的新闻图片等用到的就是图片轮播这种效果,实现方式主要有两种,一种是ScrollView+ImageView,另一种则是通过CollectionView,今天总结的是ScrollView这种方式。 1.图片轮播效果实现 主要实现思路是:根据图片总数及宽高设置好ScrollView的大小,每切换一张图片相当于在ScrollView上进行一个图片宽度的移动行为...
2015-11-24 10:34:00
273
转载 C语言基础(二)
1.BOOL类型 2.关系运算符 3.逻辑运算符 4.if类型 5.条件运算符 6.枚举类型 7.switch类型 8.循环: 1.while结构 2.for结构 3.do…..while 4程序的三种结构 5双层for循环 转载于:https://www.cnblogs.com/sharkHZ/p/4984232.html...
2015-11-21 17:30:00
174
转载 c语言基础(一)
二进制:8421 快捷键:command+alt+0 边框 command+/ 将选中的代码注释 command+z 撤销 command+m 当前界面最小化 command+w 关闭当前窗口 ...
2015-11-21 17:29:00
200
转载 数组
一维数组:int,charfloat 一维数组的结构:类型修饰符数组名[数组元素个数]=初始值; 注意事项:数组元素不能是变量,一般整型表达式. 数组的排序:冒泡排序法(交换两个变量的三种方法),,,,其他排序方法 字符数组:用双引号定义””,通常字符串是以\0结束但他不计入字符串长度 字符数组的几种类型:strlen 计算字符串长度 ...
2015-11-21 17:28:00
155
转载 构造类型:数组\枚举\结构体
构造类型:数组\枚举\结构体 #import <Foundation/Foundation.h>//结构体:构造类型,是一种自定义类型.//struct CPoint//struct 是关键字用来声明结构体 后面是结构体的名字 花括号里面的内容叫成员变量//{// float x;// float y;// //};// 以分号结尾 typedef s...
2015-11-21 17:27:00
127
转载 函数
//函数:具有特定功能的代码段 //分类:库函数;自定义函数 //定义:返回值,参数(在main函数外面去定义函数) //函数的构成 返回值类型 函数名(参数){函数体} //定义第一种 无参数 无返回值void sayhello() { printf("别闹!\n"); }//第二种 无参数 有返回值int studentCount() { r...
2015-11-21 17:27:00
115
转载 指针
指针----------指针就是地址 数据访问的两种形式:1直接访问2间接访问 地址:内存单元的编号 64位二进制 数据类型:基本数据类型 构造类型 指针类型 void类型 指针变量:指针在定义变量的过程中是一种数据类型,但在开发过程中指针是地址 指针变量 所占字节值与操作系统有关 int *中间虽然有空格 但他是整型指针类型 32位操作系统 指针变量都占4个字节 ...
2015-11-21 17:26:00
134
转载 预编译宏定义
总结: 1.结构体指针如何人访问成员 2.结构体数组与指针如何访问某个元素的成员 3.条件编译如何进行条件编译 #import <Foundation/Foundation.h> //预编译//宏定义#define PI 3.1415926//#define 的第一种形式#define S(a,b) (a*b)//#define 的第二种形式//注意:1推荐用大写 ...
2015-11-21 17:25:00
208
转载 内存的五大分区
结构体数组. 结构体指针-> //内存的五大分区: 栈区,堆区,静态去,常量区,代码区//代码区:代码在编译后形成的二进制都放在代码区;//常量区:放在常量区的常量是只读不可写的 // const int a = 5;//加了const关键字后就放在了常量区 // a = 6;//常量区的常量不能再次赋值 // const fl...
2015-11-21 17:23:00
194
转载 进击的UI-------------------RAC
http://nshipster.cn/reactivecocoa/ RAC 具有函数式编程和响应式编程的特性。它主要吸取了 .Net 的 Reactive Extensions 的设计和实现。 一些学习资源 博客 & 教程 http://spin.atomicobject.com/2014/02/03/objective-c-delegate-pattern/ ...
2015-11-21 17:22:00
93
转载 函数指针和回调函数
1函数指针 声明一个max函数 int max(int a,int b); 函数的定义 int (*p)(int ,int );//函数指针的定义 构成:返回值类型 函数指针的名字 (参数的类型) 2回调函数 int getValue(int a,int b,int (*p)(int , int));//回调函数声明(函数参数里面有一个函数指针) int getValue(...
2015-11-21 17:22:00
157
转载 进击的UI--------------------(邮箱,手机,车牌号验证)
#pragma mark - 私有方法 #pragma mark 邮箱验证 - (BOOL)isValidateEmail:(NSString *)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest =...
2015-11-21 17:18:00
419
转载 进击的UI----------------(常见快捷键的使用)
~~~~~~~~~~~~~~~~~~~~~~背景~~~~~~~~~~~~~~~~~~~~~~ // 作为一名 ‘iOS开发工程师’,你应该学会熟练的使用XCode进行代码编写,所以建议大家去使用快捷键进行开发,因为: // 1. 可以让我们显得更加的专业,逼格更高 // 2. 提高我们的开发效率,节省开发时间 // 3. 使用任何人的电脑将熟练,快速的操作(不建议大家更改系统自带...
2015-11-21 17:18:00
134
转载 进击的UI---------------------(nil Nil NULL NSNULL)
1.nil >Defines the id of a null instance. 定义一个实例为空, 指向oc中对象的空指针. >示例代码: NSString *someString = nil; NSURL *someURL = nil; id someObject = nil; if (anotherObject =...
2015-11-21 17:17:00
123
转载 进击的UI---------------UIPickerView
效果图: #import "RootViewController.h" @interface RootViewController () @end @implementation RootViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBun...
2015-11-21 17:17:00
102
转载 进击的UI----------------UISearchBar(搜索框)
谓词 self.searchBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.frame), 40)]; [self addSubview:_searchBar]; // 占位符 [self.searchBar setPlaceholder:@"请输...
2015-11-21 17:16:00
109
转载 进击的UI-------------------UIPageControl(滑动控制)
// UIPageControl的常用方法 UIPageControl *onePageControl = [[UIPageControl alloc] init]; onePageControl.frame = CGRectMake(10, 100, 300, 30); // 设置位置 onePageControl.backgroundColor = [UIColor redCo...
2015-11-21 17:15:00
163
转载 进击的UI------------UIToolBar(bottom导航条)
1.效果 2.代码 转载于:https://www.cnblogs.com/sharkHZ/p/4984188.html
2015-11-21 17:15:00
159
转载 进击的UI---------------------UIStepper(加减)
// UIStepper的常用方法 UIStepper *oneStepper = [[UIStepper alloc] init]; oneStepper.frame = CGRectMake(20, 20, 20, 20); oneStepper.backgroundColor = [UIColor blueColor]; // 设置背景色 oneStepper.tintCo...
2015-11-21 17:14:00
99
转载 进击的UI-----------------UIActivityIndicatorView(活动指示器)
// UIActivityIndicatorView的常用方法 活动指示器,就是旋转进度轮 UIActivityIndicatorView *oneIndicatorView = [[UIActivityIndicatorView alloc] init]; oneIndicatorView.activityIndicatorViewStyle = UIActivityIndicat...
2015-11-21 17:13:00
129
转载 进击的UI--------------UIActionSheet(提示)
// UIActionSheet这个控件很常用,和UIAlertView类似,先附图 // 添加了过多的选项,就会以列表的形式显示 // 正常显示 // 下面直接上代码 // 注意,需要在头文件中实现UIActionSheetDelegate协议 UIActionSheet *actionSheet = [[UIActio...
2015-11-21 17:13:00
113
转载 进击的UI----------------UIProgressView(进度条)
// UIProgressView的使用 常用于歌曲的和下载的进度条 UIProgressView *oneProgressView = [[UIProgressView alloc] init]; oneProgressView.frame = CGRectMake(0, 30, 320, 30); // 设置UIProgressView的位置和大小 oneProgressVie...
2015-11-21 17:12:00
112
转载 进击的UI--------------UIAVPlayer(视频)
#import "RootViewController.h" #import <AVFoundation/AVFoundation.h>// 引入@interface RootViewController ()@property (nonatomic,strong)AVPlayer *player;@property (nonatomic,strong)AVPlayerIt...
2015-11-21 17:11:00
361
转载 进击的UI-------------UIAlertView(警告)
// UIAlertView的常用方法 // 标准样式 UIAlertView *oneAlertView = [[UIAlertView alloc] initWithTitle:@"标题" message:@"提示内容" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles:@"OK", nil]; [oneAlertV...
2015-11-21 17:10:00
93
转载 进击的UI---------------------UITextView(文本框)
// UITextView的常用方法 主要用来输入和显示多行文本信息 UITextView *oneTextView = [[UITextView alloc] init]; oneTextView.frame = CGRectMake(0, 20, 320, 200); // 设置位置 oneTextView.backgroundColor = [UIColor whiteCol...
2015-11-21 17:10:00
99
转载 进击的UI------------------UIDatePicker(时间)
{ // UIDatePicker控件的常用方法 时间选择控件 UIDatePicker *oneDatePicker = [[UIDatePicker alloc] init]; oneDatePicker.frame = CGRectMake(0, 10, 320, 300); // 设置显示的位置和大小oneDatePicker.date = [NSDate date]; ...
2015-11-21 17:09:00
99
转载 进击的UI---------------UISwitch(开关)
{ // UISwitch的使用 UISwitch *oneSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(20, 20, 0, 0)]; // 默认尺寸为79 * 27。 oneSwitch.backgroundColor = [UIColor greenColor]; // 设置背景色 oneSwitch.alpha =...
2015-11-21 17:08:00
132
转载 进击的UI-----------------UIWindow&UIView&UILabel
1.UIWindow 定义初始: 1⃣️:初始化窗口:self.window = [[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]]autorelease]; 2⃣️:设置背景色:self.window.backgroundColor = [UIColor whiteColor]; 3⃣️:让window显...
2015-11-21 17:07:00
129
转载 进击的UI---------------- UITextField&UIButton
1.UITextField 1⃣️:初始给值 UITextField *textfield1= [[UITextField alloc]initWithFrame:CGRectMake(100, 100, 150, 40)]; textfield1.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 ...
2015-11-21 17:06:00
122
转载 进击的UI---------------------UIEvent&UITouch&UIResponder
1.UIEvent(事件) 1⃣️:事件分为三种:1 触摸事件 2 晃动事件 3 远程控制 2⃣️:触摸事件 //1. UIControlEventTouchUpInside 点击进去(点后松手) //2. UIControlEventTouchDown 单击(点就出) //3. UIControlEventTouchDownRepeat 双击...
2015-11-21 17:05:00
149
转载 进击的UI-----------------自定义视图&检测屏幕旋转&处理内存警告
1.自定义视图 流程: 1⃣️ 新建一个类 继承于UIView 2⃣️ 将控件写成view的属性 3⃣️ .m初始化 4⃣️ 直接在类外引入头文件 调用 5⃣️ 注意: 建议不要把控件的初始化写在系统的初始化方法里直接用self调方法 自己封装方法 2.视图控制器指定自定义View 新建ViewController就是MVC(Mode(模型) View(视图) Co...
2015-11-21 17:05:00
112
转载 进击的UI---------------target/action设计模式&Delegate&手势识别
1.target/action设计模式: AppDelegate.m RootViewController.m ClickView.h ClickView.m ColorView.h ColorView.m RootView.h RootView.m ButtonView.h ButtonView.m 2.delegate设计模式(代理): ...
2015-11-21 17:04:00
113
转载 进击的UI------------------UISegmentedControl&UISlide
1.UISegmentedControl ①:初始 self.segment = [[UISegmentedControl alloc]initWithItems: [NSArray arrayWithObjects:@"一卡通",@"信用卡",@"一网通", nil]]; self.segment.frame = CGRectMake(0, 20, self.frame.s...
2015-11-21 17:03:00
120
转载 进击的UI-------------------UIScrollView&UIPageControl
1.UIScroLLView基本 1⃣️:初始 self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(100, 100,200, 400)]; self.scrollView.backgroundColor = [UIColor whiteColor]; 2⃣️:contentSize self.scro...
2015-11-21 17:02:00
133
转载 进击的UI----------------------UINavigationController&UINavigationBar&界面间的传值
1.UINavigationController 1⃣️:初始 UINavigationController *rootNC = [[UINavigationController alloc]initWithRootViewController:rootVC]; 2⃣️:self.window设置主controller self.window.rootViewControll...
2015-11-21 17:02:00
98
转载 进击的UI-----------------UITableView(表视图)
tintColor 标题色 barTintColor 背景色 1.UITableView表视图 1⃣️:Plain:self.tableView = [[UITableView alloc]initWithFrame:self.bounds style:UITableViewStylePlain]; 2⃣️:Grouped:self.tableView = [[UITab...
2015-11-21 17:01:00
125
转载 进击的UI------------------- Plist&自定义Cell
1.plist NSString *filePath = [[NSBundle mainBundle]pathForResource:@"name" ofType:@"plist"]; NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:filePath]; 2.tableView的自定义cell 1⃣️...
2015-11-21 17:00:00
102
转载 进击的UI--------------- UITableView&UITableView的移动
1.UITableView补充 1⃣️:-(void)p_data @property (nonatomic,retain)NSMutableArray *dataArray; @property (nonatomic,assign)UITableViewCellEditingStyle editStyle; - (void)p_data{ NSMutableAr...
2015-11-21 17:00:00
129
转载 进击的UI------------------单例(相机)&UITabBarController&Block
1.单例 1⃣️:单例类:单例类可以初始化一个单例对象 只被初始化一次,它的生命周期和整个程序的生命周期一样,一般用来传值 2⃣️: 步骤 ①:必须有一个类方法 + (instancetype)shareHandle; ②:单例对象 放在静态区 static DataHandle *handel = nil; ③:实现方法 + (instancetype)shareHa...
2015-11-21 16:59:00
137
转载 进击的UI-------------多种Cell混合使用&懒加载&自适应高度
1.自定义控件 2.model 3.多种cell混合使用 4自适应高度 5.懒加载 转载于:https://www.cnblogs.com/sharkHZ/p/4984105.html
2015-11-21 16:59:00
127
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅