zoukankan      html  css  js  c++  java
  • [某鸥实训记][objective-c][第一天][个人笔记]

    UIView,UILabel,UITextField,ViewController.....

    然而上面这些都并没太搞懂......

    下面是学到的东西=w=

    //一边百度一边学的..所以很多东西都来自别的blog..后边会贴出出处

    .frame :控件相对于父视图的位置

    UITextField.borderStyle :UITextField的样式

    .text :控件显示的文本

    .backgroundColor :控件的背景颜色(然而设置了这个会让控件的某些属性无效)

    UIColor :一个颜色的类...然而我并没有看懂

    //http://www.cnblogs.com/smileEvday/archive/2012/06/05/UIColor_CIColor_CGColor.html

    - addSubview:(UIView *) :向视图中添加子视图

     CGRectMake(<CGFloat x>, <CGFloat y>, <CGFloat width>, <CGFloat height>) :参数相对于父视图的x,y偏移和dx,dy.返回一个CGRect值.

    //http://blog.csdn.net/chengyingzhilian/article/details/7894276

    addTarget:<(id)> action:<(SEL)> forControlEvents:<(UIControlEvents)> :执行动作的目标,执行动作的函数,和在什么时候执行动作

    [button addTarget:self action: @selector(back:) forControlEvents:UIControlEventTouchUpInside];

    ↑↑↑↑这是例子,在这个ViewController(self)中,执行back:这个函数,在按下而且在空间范围内弹起是响应

    //这里有各种事件的说明http://blog.csdn.net/g5dsk/article/details/6613943

    resignFirstResponder :这个可以用在UITextField上来释放第一响应....能收回键盘

    UIBarButton :可以添加到navigationItem上的按钮

    pushViewController:<(UIViewController *)> animated:<(BOOL)> :推出一个ViewController 可以用来切换页面,animated用来控制有没有推出动画

    popToRootViewControllerAnimated:<(BOOL)>:返回调用它的视图控制器.同样可以选择有没有动画

    /*上边就是我挑选出来的这一天学到的....下面是一些没有整理过的示例代码*/

        UIView *view = [[UIView alloc]init];
        view.frame = CGRectMake(0, 0, 100, 100);
        view.backgroundColor = [UIColor yellowColor];
        [self.view addSubview:view];

        UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
        button.frame = CGRectMake(100, 100, 100, 100);
        button.backgroundColor = [UIColor blueColor];
        [button addTarget:self action:@selector(push) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:button]
    -(void)push{
        FirstViewController *first = [[FirstViewController alloc] init];
        [self.navigationController pushViewController:first animated:YES];
    }
    
  • 相关阅读:
    库存回滚架构设计原则
    老人血脂高吃什么好
    旁边的旁边的旁边--纪念自己逝去的青春
    JAVA8 Map新方法:compute,computeIfAbsent,putIfAbsent与put的区别
    新晋总监生存指南终章——构建技术团队信息通道
    新晋总监生存指南五——人才运营机制,技术团队如何解决造血能力
    新晋总监生存指南四——项目执行指南,如何挽救混乱的项目
    新晋总监生存指南三——OKR,先进的管理工具
    新晋总监生存指南二——建立指标
    新晋总监生存指南开篇之总监二三事
  • 原文地址:https://www.cnblogs.com/NyaSu/p/4798798.html
Copyright © 2011-2022 走看看