PHP群:95885625 Hbuilder+MUI群:81989597 站长QQ:634381967
    您现在的位置: 首页 > 开发编程 > iOS开发教程 > 正文

    关于UITextField边距

    作者:张志勇来源:原创浏览:时间:2020-09-30 00:07:50我要评论
    导读:UITextField内边距CGRect = [accountTextField ]; .size.width=7.0f; UIView*leftview = [[UIViewalloc]initWith : ]; acc...
    UITextField内边距

    CGRect  = [accountTextField  ];

        .size.width = 7.0f;

        UIView *leftview = [[UIView alloc] initWith : ];

        accountTextField.leftViewMode = UITextFieldViewModeAlways;

        accountTextField.leftView = leftview;

    多个textfield的时候不要用一个leftview,

     

    比如:

    错误例

    UIView *aLeftview = [[UIView alloc] initWith : ]

    aTF.leftView = aLeftview;

    bTF.leftView = aLeftview;

    cTF.leftView = aLeftview;

     

    摘自http://blog.163.com/china_uv/blog/static/117137267201462132642700/

    感谢china_uv博友

     

    新编辑补充 

    改变边框:

    textField. .cornerRadius = 8.0f;//圆角 textField. .masksToBounds = YES; textField. .borderColor = [[UIColor redColor]CGColor]; textField. .borderWidth = 1.0f;//边框宽

    转载请注明(B5教程网)原文链接:https://b5.mxunkeji.com/content-155-5995-1.html
    相关热词搜索: