How to hide UITextField border?

后端 未结 7 1760
星月不相逢
星月不相逢 2020-12-30 21:00

I have a UITextField and I am trying to make the UITextField border invisible so that the background and UITextField would have the same color and there would be a seamless

7条回答
  •  北海茫月
    2020-12-30 21:09

    UITextField *tfText = [[UITextField alloc] initWithFrame:CGRectMake(65, 200, 200, 30)];
        tfText.backgroundColor = [UIColor colorWithRed:0.2 green:0.9 blue:0.5 alpha:0.3];       
        tfText.textAlignment = UITextAlignmentCenter;
        // Border Style None
        [tfText setBorderStyle:UITextBorderStyleNone];
        [self.view addSubview:tfText];
        [tfText release];
    

提交回复
热议问题