iOS - UI - UIWebView
摘要:1、UIWebView UIWebView 是 苹果提供的用来展示网页的UI控件。它也是最占内存的控件。 iOS8.0 webkit框架。 WKWebView,相比UIWebView,节省了1/3~1/4的内存,速度快,但是没缓存功能。 iOS开发 Xcode native原生开发 + Html5
阅读全文
UIPickerView 简单操作和实际应用
摘要:1、UIPickerView 选择指示器控件 //选择器的初始化 UIPickerView * pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 50, self.view.bounds.size.width, 300)];
阅读全文
UICollectionView 简单应用和实际操作
摘要:1、网格视图 UICollectionView 网格布局 UICollectionViewFlowLayout系统图自带网格布局 系统自带的网格布局 UICollectionViewFlowLayout * flowLayout = [[UICollectionViewFlowLayout allo
阅读全文
UITableView 的增删改 自定义UITableViewCell
摘要:1、UITableView的增删改 //设置编辑模式 [self.tableView setEditing:YES animated:YES]; //可以不写 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIn
阅读全文
iOS - UI - UIPageControl
摘要:1、UIPageControl 分页控件 //分页控件初始化 UIPageControl * pageControl = [[UIPageControl alloc] init]; //分页页数 pageControl.numberOfPages = 5; //当前页数 pageControl.cu
阅读全文
iOS - UI - UITableView
摘要:1、UITableView 表格视图 服从数据源 - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {}返回的视图推不上去 但是tableHeaderView 可以推上去
阅读全文
iOS - UI - UITextView
摘要:1、UITextView //因为继承于UIScrollView 拥有scrollView的所有属性和方法 //placeholder只有UITextField有,UITextView是没有的。(提示文字) //多行文本框 UITextView * textView = [[UITextView a
阅读全文
iOS - UI - UIScrollView
摘要:1、UIScrollView 滚动视图 // 滚动视图 UIScrollView* scrollView = [[UIScrollView alloc]initWithFrame:self.view.bounds]; // **设置滚动内容的大小 //如果size值为0,默认是scroll.boun
阅读全文
iOS 手势大全
摘要:1、Touch事件 //系统自动调用 //一个UITouch代表一根手指 按住option变成两根手指 //虽然是两个手指,但只执行一次触摸事件 //系统自动调用 //一个UITouch代表一根手指 按住option变成两根手指 //虽然是两个手指,但只执行一次触摸事件 - (void)touche
阅读全文
iOS 模态视图
摘要:2、模态视图 ModelViewController * modelVC = [[ModelViewController alloc] init]; modelVC.delegate = self; //设置模态视图的转场动画 // modelVC.modalTransitionStyle = UI
阅读全文
iOS - 导航控制器
摘要:1、导航控制器 self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; self.window.backgroundColor = [UIColor blackColor]; [self.window
阅读全文
UITabbar的简单操作和实际应用
摘要:简易编辑Tabbar //**标签栏控制器的初始化 UITabBarController * tabbarC = [[UITabBarController alloc] init]; //设置tabBar的颜色 tabbarC.tabBar.barTintColor = [UIColor brown
阅读全文
iOS UINavigationController 详解
摘要:developer.apple.com/cn/ 导航条 UINavigationBar继承UIView 导航控制器 UINavigationController (压栈,出栈) UINavigationItem(加载导航条上的东西) UIBarButtonItem (导航条左右按钮) 视图控制器 V
阅读全文
iOS - 生命周期
摘要:1、视图控制器的生命周期 - (void)loadView 不建议使用,一定不要手动调用。主要是用来生成viewcontroller的view的,具体原理,如果视图控制器 self.view = nil。会自动调用loadView //当loadView,没有生成self.view,会产生死循环 /
阅读全文
iOS - UI - UISwitch
摘要:UISwitch //开关 不用设置宽高 有默认宽高 UISwitch * sw = [[UISwitch alloc] initWithFrame:CGRectMake(100, 100, 0, 0)]; //开关的状态 sw.on = YES; //开关打开时的颜色 sw.onTintColor
阅读全文
iOS - 提示信息 - UIAlertView、UIActionSheet、UIAlertController的实际应用
摘要:1、UIAlertView(屏幕中央弹出框)(不需要服从代理) UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"title" message:@"message" delegate:self cancelButtonTit
阅读全文
iOS - UI - UISegmentedControl
摘要:1、UISegmentedControl 1、UISegmentedControl NSArray * array = @[@"red",@"green",@"yellow",@"blue",@"orange"]; //分段选择器 UISegmentedControl * segment = [[U
阅读全文
iOS - UI - UISlider
摘要:6、UISlider //滑块 设置高度 UISlider * slider = [[UISlider alloc] initWithFrame:CGRectMake(20, 100, CGRectGetWidth(self.view.frame) - 40,30 )]; // slider.bac
阅读全文
iOS - UI - UIStepper
摘要:7、UIStepper //计数器控件 固定宽高 UIStepper * stepper = [[UIStepper alloc] initWithFrame:CGRectMake(100, 100, 0, 0)]; [self.view addSubview:stepper]; stepper.v
阅读全文
UITextField的简单操作和实际应用
摘要:UITestField UITestField* testField = [UITestField alloc]initWithFrame]; /* 设置边框样式 typedef NS_ENUM(NSInteger, UITextBorderStyle) { UITextBorderStyleNon
阅读全文