iOS 修改textholder的颜色

iOS 修改textholder的颜色
UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(10, 50, 320, 50)];
    textField.placeholder = @"填写订单";
    if ([textField respondsToSelector:@selector(setAttributedPlaceholder:)]) {
        UIColor *color = [UIColor redColor];
        textField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"填写订单" attributes:@{NSForegroundColorAttributeName: color}];
    } else {
        NSLog(@"Cannot set placeholder text‘s color, because deployment target is earlier than iOS 6.0");
        // TODO: Add fall-back code to set placeholder color.
    }
    [self.view addSubview:textField];
iOS 修改textholder的颜色

iOS 修改textholder的颜色,布布扣,bubuko.com

iOS 修改textholder的颜色

上一篇:在Windows7下构建Android的开发环境


下一篇:Android开发之开机启动没有界面的应用程序