自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(96)
  • 收藏
  • 关注

转载 无限轮播图的实现

平时APP中的广告位、或者滚动的新闻图片等用到的就是图片轮播这种效果,实现方式主要有两种,一种是ScrollView+ImageView,另一种则是通过CollectionView,今天总结的是ScrollView这种方式。1.图片轮播效果实现主要实现思路是:根据图片总数及宽高设置好ScrollView的大小,每切换一张图片相当于在ScrollView上进行一个图片宽度的移动行为...

2015-11-24 10:34:00 187

转载 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 116

转载 c语言基础(一)

二进制:8421快捷键:command+alt+0 边框 command+/ 将选中的代码注释 command+z 撤销 command+m 当前界面最小化 command+w 关闭当前窗口 ...

2015-11-21 17:29:00 117

转载 数组

一维数组:int,charfloat一维数组的结构:类型修饰符数组名[数组元素个数]=初始值;注意事项:数组元素不能是变量,一般整型表达式.数组的排序:冒泡排序法(交换两个变量的三种方法),,,,其他排序方法字符数组:用双引号定义””,通常字符串是以\0结束但他不计入字符串长度字符数组的几种类型:strlen 计算字符串长度 ...

2015-11-21 17:28:00 110

转载 构造类型:数组\枚举\结构体

构造类型:数组\枚举\结构体#import <Foundation/Foundation.h>//结构体:构造类型,是一种自定义类型.//struct CPoint//struct 是关键字用来声明结构体 后面是结构体的名字 花括号里面的内容叫成员变量//{// float x;// float y;////};// 以分号结尾typedef s...

2015-11-21 17:27:00 75

转载 函数

//函数:具有特定功能的代码段//分类:库函数;自定义函数//定义:返回值,参数(在main函数外面去定义函数)//函数的构成 返回值类型 函数名(参数){函数体}//定义第一种 无参数 无返回值void sayhello(){ printf("别闹!\n");}//第二种 无参数 有返回值int studentCount(){ r...

2015-11-21 17:27:00 74

转载 指针

指针----------指针就是地址数据访问的两种形式:1直接访问2间接访问地址:内存单元的编号 64位二进制数据类型:基本数据类型 构造类型 指针类型 void类型指针变量:指针在定义变量的过程中是一种数据类型,但在开发过程中指针是地址指针变量 所占字节值与操作系统有关int *中间虽然有空格 但他是整型指针类型32位操作系统 指针变量都占4个字节...

2015-11-21 17:26:00 95

转载 预编译宏定义

总结: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 130

转载 内存的五大分区

结构体数组. 结构体指针->//内存的五大分区: 栈区,堆区,静态去,常量区,代码区//代码区:代码在编译后形成的二进制都放在代码区;//常量区:放在常量区的常量是只读不可写的 // const int a = 5;//加了const关键字后就放在了常量区 // a = 6;//常量区的常量不能再次赋值 // const fl...

2015-11-21 17:23:00 129

转载 进击的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 61

转载 函数指针和回调函数

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 110

转载 进击的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 328

转载 进击的UI----------------(常见快捷键的使用)

~~~~~~~~~~~~~~~~~~~~~~背景~~~~~~~~~~~~~~~~~~~~~~// 作为一名 ‘iOS开发工程师’,你应该学会熟练的使用XCode进行代码编写,所以建议大家去使用快捷键进行开发,因为:// 1. 可以让我们显得更加的专业,逼格更高// 2. 提高我们的开发效率,节省开发时间// 3. 使用任何人的电脑将熟练,快速的操作(不建议大家更改系统自带...

2015-11-21 17:18:00 96

转载 进击的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 81

转载 进击的UI---------------UIPickerView

效果图:#import "RootViewController.h"@interface RootViewController ()@end@implementation RootViewController- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBun...

2015-11-21 17:17:00 66

转载 进击的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 59

转载 进击的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 111

转载 进击的UI------------UIToolBar(bottom导航条)

1.效果2.代码转载于:https://www.cnblogs.com/sharkHZ/p/4984188.html

2015-11-21 17:15:00 112

转载 进击的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 53

转载 进击的UI-----------------UIActivityIndicatorView(活动指示器)

// UIActivityIndicatorView的常用方法 活动指示器,就是旋转进度轮UIActivityIndicatorView *oneIndicatorView = [[UIActivityIndicatorView alloc] init];oneIndicatorView.activityIndicatorViewStyle = UIActivityIndicat...

2015-11-21 17:13:00 90

转载 进击的UI--------------UIActionSheet(提示)

// UIActionSheet这个控件很常用,和UIAlertView类似,先附图// 添加了过多的选项,就会以列表的形式显示// 正常显示// 下面直接上代码// 注意,需要在头文件中实现UIActionSheetDelegate协议UIActionSheet *actionSheet = [[UIActio...

2015-11-21 17:13:00 70

转载 进击的UI----------------UIProgressView(进度条)

// UIProgressView的使用 常用于歌曲的和下载的进度条UIProgressView *oneProgressView = [[UIProgressView alloc] init];oneProgressView.frame = CGRectMake(0, 30, 320, 30); // 设置UIProgressView的位置和大小oneProgressVie...

2015-11-21 17:12:00 70

转载 进击的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 258

转载 进击的UI-------------UIAlertView(警告)

// UIAlertView的常用方法// 标准样式UIAlertView *oneAlertView = [[UIAlertView alloc] initWithTitle:@"标题" message:@"提示内容" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles:@"OK", nil];[oneAlertV...

2015-11-21 17:10:00 63

转载 进击的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 60

转载 进击的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 74

转载 进击的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 76

转载 进击的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 88

转载 进击的UI---------------- UITextField&UIButton

1.UITextField1⃣️:初始给值UITextField *textfield1= [[UITextField alloc]initWithFrame:CGRectMake(100, 100, 150, 40)];textfield1.backgroundColor = [UIColor colorWithRed:arc4random() % 256 / 255.0 ...

2015-11-21 17:06:00 88

转载 进击的UI---------------------UIEvent&UITouch&UIResponder

1.UIEvent(事件)1⃣️:事件分为三种:1 触摸事件 2 晃动事件 3 远程控制2⃣️:触摸事件//1. UIControlEventTouchUpInside 点击进去(点后松手)//2. UIControlEventTouchDown 单击(点就出)//3. UIControlEventTouchDownRepeat 双击...

2015-11-21 17:05:00 84

转载 进击的UI-----------------自定义视图&检测屏幕旋转&处理内存警告

1.自定义视图流程:1⃣️ 新建一个类 继承于UIView2⃣️ 将控件写成view的属性3⃣️ .m初始化4⃣️ 直接在类外引入头文件 调用5⃣️ 注意: 建议不要把控件的初始化写在系统的初始化方法里直接用self调方法 自己封装方法2.视图控制器指定自定义View新建ViewController就是MVC(Mode(模型) View(视图) Co...

2015-11-21 17:05:00 79

转载 进击的UI---------------target/action设计模式&Delegate&手势识别

1.target/action设计模式:AppDelegate.mRootViewController.mClickView.hClickView.mColorView.hColorView.mRootView.hRootView.mButtonView.hButtonView.m2.delegate设计模式(代理):...

2015-11-21 17:04:00 79

转载 进击的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 79

转载 进击的UI-------------------UIScrollView&UIPageControl

1.UIScroLLView基本1⃣️:初始self.scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(100, 100,200, 400)];self.scrollView.backgroundColor = [UIColor whiteColor];2⃣️:contentSizeself.scro...

2015-11-21 17:02:00 92

转载 进击的UI----------------------UINavigationController&UINavigationBar&界面间的传值

1.UINavigationController1⃣️:初始UINavigationController *rootNC = [[UINavigationController alloc]initWithRootViewController:rootVC];2⃣️:self.window设置主controllerself.window.rootViewControll...

2015-11-21 17:02:00 66

转载 进击的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 89

转载 进击的UI------------------- Plist&自定义Cell

1.plistNSString *filePath = [[NSBundle mainBundle]pathForResource:@"name" ofType:@"plist"];NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:filePath];2.tableView的自定义cell1⃣️...

2015-11-21 17:00:00 69

转载 进击的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 101

转载 进击的UI------------------单例(相机)&UITabBarController&Block

1.单例1⃣️:单例类:单例类可以初始化一个单例对象 只被初始化一次,它的生命周期和整个程序的生命周期一样,一般用来传值2⃣️:步骤①:必须有一个类方法+ (instancetype)shareHandle;②:单例对象 放在静态区static DataHandle *handel = nil;③:实现方法+ (instancetype)shareHa...

2015-11-21 16:59:00 86

转载 进击的UI-------------多种Cell混合使用&懒加载&自适应高度

1.自定义控件2.model3.多种cell混合使用4自适应高度5.懒加载转载于:https://www.cnblogs.com/sharkHZ/p/4984105.html

2015-11-21 16:59:00 85

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除