UIButton 的不同设置和UITextField 的默认值(修改默认值)

    UIButton *btn31 = [[UIButton alloc]initWithFrame:CGRectMake(200, 0, 65, 40)];

    

    [btn31 setTitle:@"获取验证码" forState:UIControlStateNormal];

    [btn31.titleLabel setFont:[UIFont systemFontOfSize:12.0]];

    [btn31 setTitleColor:[UIColor colorWithRed:19/255.0f green:181/255.0f blue:224/255.0f alpha:1] forState:UIControlStateNormal];

    

    [field addSubview:btn31];


    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeRoundedRect];

    

    [btn2 setFrame:CGRectMake(10, 100, 300, 40)];

    [btn2 setTitle:@"登录" forState:UIControlStateNormal];

    [btn2.titleLabel setFont:[UIFont systemFontOfSize:17.0]];

    [btn2.titleLabel setTextAlignment:NSTextAlignmentCenter];

    [btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];

    [btn2 setBackgroundImage:[UIImage imageNamed:@"[email protected]"] forState:UIControlStateNormal];

    [btn2 setBackgroundImage:[UIImage imageNamed:@"[email protected]"] forState:UIControlStateHighlighted];




    [field3 setPlaceholder:@"验证码"];

    [field3 setValue:[UIColor colorWithRed:176/255.0f green:176/255.0f blue:176/255.0f alpha:1] forKeyPath:@"_placeholderLabel.textColor"];





    


你可能感兴趣的:(UIButton 的不同设置和UITextField 的默认值(修改默认值))