zoukankan      html  css  js  c++  java
  • ios 学习笔记之控件属性

    1.文本框

    设置密码属性:Secure Text Entry 勾选;

    设置文本框带清除属性: Clear Button =Is always visible;  默认是不带清除属性:Never appears 

    设置文本框默认带出文字属性:Placeholder=用户自定义输入;

    设置文本框键盘用户输入完成隐藏代码:

      [self.text resignFirstResponder];//适用于单个文本框输入完成时隐藏

      [self.view endEditing:YES];//适用于全部文本框输入完成时隐藏;

    2.按钮

    设置高亮状态:State Config =Highlighted(高亮) Default (默认状态);

    设置默认状态和高亮状态下设置按钮背景图片属性:Background=用户自定义图片名称,例如 img_01;

    3、属性

    HigHlighed Adjusts Image  高亮状态点击无的反映
    User Interaction Enabled  是否与用户交互
    4、设置状态栏
    //改变状态栏的文字颜色为白色
    - (UIStatusBarStyle)preferredStatusBarStyle
    {
        return UIStatusBarStyleLightContent;
    }
    //隐藏状态栏
    -(BOOL)prefersStatusBarHidden
    {
        return YES;
    }
     UIAlertView * alerView = [[UIAlertView alloc] initWithTitle:@"操作提示" message:@"恭喜通关!" delegate:nil cancelButtonTitle:@"确定"otherButtonTitles:@"确定",nil];     
    //显示对话框
     [alerView show];
    //设置userview与用户交互
     self.userview.userInteractionEnabled =YES;
    //清除所有控件
     [self.userview.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    //给userBtn添加单击事件 @selector(optiondataClick:)把当前点击的按钮传到事件中
     [userBtnaddTarget:self action:@selector(optiondataClick:) forControlEvents:UIControlEventTouchUpInside];
     //声明空的字符串变量拼接时使用
     NSMutableString* userInput =[NSMutableString string];
     //拼接
     [userInput appendString:Data];
     //延迟0.5秒调用方法
    [self performSelector:@selector() withObject:nil afterDelay:0.5];
     //把view 中的一个子控件显示到最上层
     [self.view bringSubviewToFront:self.btnIcon];
    //获取当前页面,最后一个控件最大的的Y值;
      CGFloat MaxH = CGRectGetMaxY(self.lastImageView.frame);
    //获取当前页面,最后一个控件最大的的X值;
      CGFloat MaxH = CGRectGetMaxX(self.lastImageView.frame);
  • 相关阅读:
    vue引用js报错Uncaught SyntaxError: Unexpected token <
    VS Code离线安装扩展方法
    zTree、jsTree排序和简单的js数字字符串混合排序方法
    C# 如何读取匿名类型Anonymous Type的属性
    ajax使用jsonp请求方式
    VS2015 Bad Request解决方法
    C# json对象中包含数组对象时,如何存入数据库
    js 最短代码生成随机数(字符串、id)
    HDU 6395 Sequence 杜教板子题
    hdu GuGuFishtion 6390 数论 欧拉函数
  • 原文地址:https://www.cnblogs.com/zzgt/p/4796023.html
Copyright © 2011-2022 走看看