iOS_UI
yadong_zhao
这个作者很懒,什么都没留下…
展开
-
iOS_UIButton 简单操作
UIButton 风格typedef NS_ENUM(NSInteger, UIButtonType) { UIButtonTypeCustom = 0, // no button type UIButtonTypeSystem NS_ENUM_AVAILABLE_IOS(7_0), // standard system button原创 2015-06-02 21:39:42 · 538 阅读 · 0 评论 -
UI_Target/action 设计模式
RootView.m 中 UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem]; button.frame = CGRectMake(100, 100, 100, 40); [button setTitle:@"Target" forState:UIControlStateNormal]; [se原创 2015-07-04 10:18:19 · 764 阅读 · 0 评论 -
UI_UISegmentedControl 控件
创建控件- (void)createSegmentControl{ UISegmentedControl *segmentedControl = [[UISegmentedControl alloc] initWithItems:@[@"全部", @"分类", @"进行中"]]; segmentedControl.frame = CGRectMake(80, 30, 180, 30原创 2015-07-06 18:33:57 · 663 阅读 · 0 评论 -
UI_UISlider控件
#pragma mark - 创建控件 UISlider- (void)createSlider{ // 也是继承与 UIControl UISlider *slider = [[UISlider alloc] initWithFrame:CGRectMake(40, 80, 260, 27)]; // 设置颜色 slider.backgroundColor = [原创 2015-07-06 18:35:51 · 628 阅读 · 0 评论 -
UI_Singleton(单例传值)
新建一个类继承 NSObject#import <Foundation/Foundation.h>@interface FinxingDate : NSObject#pragma mark - 创建单例方法// 作为返回值的区别 id(泛型指针) 不知道具体对象 instancetype可以动态识别哪种类型// 起名习惯,share + 类名//+ (ShareData *)+ (insta原创 2015-07-13 19:13:26 · 654 阅读 · 0 评论 -
UI_UItableView_AutoCell(自定义cell)
新建类@interface YadongCell : UITableViewCell方法#pragma mark - 赋值方法- (void)setCellDateWithYadong:(CinemaModel *)sender;#pragma mark - 自定义高度+(CGFloat)height;#pragma mark - 封装+ (instancetype)getYadongCellW原创 2015-07-13 22:16:57 · 738 阅读 · 0 评论 -
UI_UIStepper控件
#pragma mark - 创建控件 UIStepper- (void)createSteppper{ UIStepper *stepper = [[UIStepper alloc] initWithFrame:CGRectMake(130, 150, 50, 20)]; // 设置 stepper 最小值,默认是0 stepper.minimumValue = 20;原创 2015-07-06 18:39:13 · 656 阅读 · 0 评论 -
UI_UISwitch控件
#pragma mark - 创建控件 UISwitch- (void)createSwitch{ UISwitch *aSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(50, 150, 0, 0)]; [self addSubview:aSwitch]; [aSwitch release]; // 添加绑定事件原创 2015-07-06 18:37:15 · 878 阅读 · 0 评论 -
UI_UItableView_AutoCell(自定义cell 高度)
#pragma mark 赋值方法-(void)setCellDataWithModel:(NewsModel *)sender{ self.titleLabel.text = sender.title; self.summaryLabel.text = sender.summary; CGFloat height = [NewsCell getHeight原创 2015-07-14 20:31:52 · 700 阅读 · 0 评论 -
UI_UIScrollView/UIpageControl
创建UIScrollView@property(nonatomic, retain) UIScrollView *scrollView;@property(nonatomic, retain) UIImageView *opeImageView;@property (nonatomic, retain)UIPageControl *pageControl;#pragma mark - 创建滑动视原创 2015-07-07 22:10:33 · 874 阅读 · 0 评论 -
UI_UIImagePickerController(读取图片)
创建图片#pragma mark - 创建 photoImageView- (void)createphotoImageView{ self.photoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 70, 320, 390)]; self.photoImageView.backgroundColor =原创 2015-07-15 15:47:27 · 527 阅读 · 0 评论 -
UI_Block传值
block 传值在第二个控制器里面声明block// 类似代理的协议typedef void(^TransmitValueBlock) (NSString *);@interface SecondViewController : UIViewController// 类似代理的定义@property (nonatomic, copy) TransmitValueBlock ablock;// 可原创 2015-07-16 17:55:27 · 779 阅读 · 0 评论 -
UI_UITabBarController
建立控制器 // 普通控制器 GroupViewController *groupVC = [[GroupViewController alloc] init]; SecondViewController *secondVC = [[SecondViewController alloc] init]; ThirdViewController *thirdVC = [[T原创 2015-07-16 14:26:17 · 600 阅读 · 0 评论 -
UI_cell 注册问题
'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ActiveListCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'原创 2015-07-18 17:57:06 · 639 阅读 · 0 评论 -
UI_storyboard实现页面回调
新建类 注意继承关系#import <UIKit/UIKit.h>@interface CustomPopIt : UIStoryboardSegue@end#import "CustomPopIt.h"@implementation CustomPopIt#pragma mark - 实现 pop 方法- (void)perform{ UIViewController *vc = se原创 2015-07-17 17:42:48 · 487 阅读 · 0 评论 -
UI_搭建MVC
新建RootViewController 继承于 UIViewController 新建RootView 继承于 UIView AppDelegate.m 中引入 #import "RootViewController.h"#pragma mark - 重写#pragma mark dealloc- (void)dealloc{ [_window release]; [su原创 2015-07-04 17:33:50 · 730 阅读 · 0 评论 -
UI_UITableView编辑
向左滑动#pragma mark - 设置 tableView 能否编辑- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath{ return YES;}#pragma mark - 左滑动哪种编辑状态- (UITableViewCellEditingStyle原创 2015-07-11 14:23:19 · 620 阅读 · 0 评论 -
iOS_UITextField 基本操作
基本操作UITextField *userNameTextField = [[UITextField alloc] init]; userNameTextField.frame = CGRectMake(30, 100, 220, 50); [self.window addSubview:userNameTextField]; [userNameTextField relea原创 2015-06-02 21:51:14 · 560 阅读 · 0 评论 -
UIView UIWindow
一、window 简介window 是窗口,每个app都要借助window将内容展现给用户看。 在iOS中,通常使用UIWIndow类来表示窗口,通常一个应用程序只创建一个UIWIndow对象。二、创建UIWindow// 1.创建window对象 self.window = [[[UIWindow alloc] init] autorelease]; // 2.设置window的位原创 2015-06-01 21:31:09 · 635 阅读 · 0 评论 -
xcode 中 UILable 使用方法简介
初始化 UILabel *lable = [[UILabel alloc] init]; // 初始化 lable.frame = CGRectMake(30, 30, 200, 50); // 设置 lable 位置和大小 lable.backgroundColor = [UIColor orangeColor]; // 设置lable背景颜色 [self.windo原创 2015-06-02 17:51:01 · 817 阅读 · 0 评论 -
UI_KVC赋值
使用KVC对person的属性进行赋值 [aperson setValue:@"yadong" forKey:@"name"]; [aperson setValue:@"man" forKey:@"sex"]; [aperson setValue:@23 forKey:@"age"]; NSLog(@"%@",[aperson valueForKey:@"name原创 2015-07-09 15:12:17 · 663 阅读 · 0 评论 -
UI_页面传值问题
属性传值 // 属性传值:最常用的一种传值方式 /** * 操作过程 * 1、在第二个控制器的.h文件里面书写属性 * 2、就在第一个页面创建第二个页面控制器方法里面,进行赋值操作 * 3、适用性(局限性):仅仅适用于从第一个页面传到第二个页面(从前往后传) */*1、在第二个控制器的.h文件里面书写属性// 设置属性用于传原创 2015-07-08 21:20:47 · 741 阅读 · 0 评论 -
UI_UINavigationController
创建 UINavigationController(导航控制器)在AppDelegate.m中创建 // 创建一个普通控制器 RootViewController *rootVC = [[RootViewController alloc] init]; // UINavigationController主要用来管理一组控制器(至少有一个),自带 view 但是不使用 UI原创 2015-07-08 21:00:27 · 576 阅读 · 0 评论 -
UI_UITableView_搭建
创建 tableViewUITableViewStyle 有两种选择#pragma mark - 创建 tableView- (void)createTableView{ // 枚举类型共有两个 self.mainTableView = [[UITableView alloc] initWithFrame:[UIScreen mainScreen].bounds style:UI原创 2015-07-09 19:10:11 · 620 阅读 · 0 评论 -
MVC三层架构
新建ViewController类 继承 UIViewControllerAppDelegate.m#import "ViewController.h"#pragma mark - 重写#pragma mark dealloc- (void)dealloc{ [_window release]; [super dealloc];} //设置window sel原创 2015-07-02 22:37:08 · 552 阅读 · 0 评论 -
封装代理
LTView.h@interface LTView : UIView { UILabel *_lable; UITextField *_textField;}#pragma mark - 自定义初始化方法- (instancetype)initWithFrame:(CGRect)frame text:(NSString *)te原创 2015-07-02 22:50:11 · 691 阅读 · 0 评论 -
UI_拖动View
方法一在touchesMoved中 // 获取到触摸的手指 UITouch *touch = [touches anyObject]; // 获取集合中对象 // 获取开始时的触摸点 CGPoint previousPoint = [touch previousLocationInView:self]; // 获取当前的触摸点 CGPoint原创 2015-07-03 12:44:12 · 476 阅读 · 0 评论 -
UI_触摸事件
基本触摸事件 #pragma mark - 重写方法 #pragma mark 触摸开始 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"touchesBegan"); NSLog(@"%s",__FUNCTION__); } #pragma mark - 触摸移动 - (void)t原创 2015-07-03 12:34:25 · 570 阅读 · 0 评论 -
UI_UIImageView 基本操作
UI_UIImageView 常用方法// 使用ImageView 通过 name 找到图片 UIImage *image = [UIImage imageNamed:@"bg_2"]; // 添加 image 到 imageView 上 UIImageView *imageView = [[UIImageView alloc] initWithImage:image];原创 2015-07-03 19:46:50 · 892 阅读 · 0 评论 -
UI_手势
轻拍手势 // 创建一个轻拍手势,同时绑定了事件 UITapGestureRecognizer *aTapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGRAction:)]; // 设置轻拍次数 aTapGR.numberOfTapsRequired = 1;原创 2015-07-04 15:24:48 · 644 阅读 · 0 评论 -
UI_模态页面跳转
前一页建立跳转事件 // 添加左边导航栏按钮 UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(leftButtonAction:)]; self.navig原创 2015-07-11 10:43:31 · 1108 阅读 · 0 评论 -
ScrollView 高度
ScrollView 上面 添加 UIView 定下 View 的约束选择水平滑动还是竖直滑动(可以直接看前面的图标,是竖着的线还是横着的线)可以将view 的高度拖成属性#import @interface ViewController : UIViewController@property (strong, nonatomic) IBOutlet NSLa原创 2015-09-08 21:36:25 · 865 阅读 · 0 评论