iOS 一些基础的方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/walkerwqp/article/details/81286809

iOS button字体居中等的设置

self.replyBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;

    UIControlContentHorizontalAlignmentCenter = 0,
    UIControlContentHorizontalAlignmentLeft   = 1,
    UIControlContentHorizontalAlignmentRight  = 2,

iOS uitextfield的一些方法

    self.replyTextField.backgroundColor = [UIColor whiteColor];
    self.replyTextField.layer.masksToBounds = YES;
    self.replyTextField.layer.cornerRadius = 5;
    self.replyTextField.layer.borderColor = fengeLineColor.CGColor;
    self.replyTextField.layer.borderWidth = 1.0f;
    self.replyTextField.font = contentFont;
    self.replyTextField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请回复" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:157/255.0 green:157/255.0 blue:157/255.0 alpha:1.0]}];
    self.replyTextField.delegate = self;
    self.replyTextField.clearButtonMode = UITextFieldViewModeWhileEditing;

猜你喜欢

转载自blog.csdn.net/walkerwqp/article/details/81286809