UITextField Only Top And Bottom Border

后端 未结 11 983
温柔的废话
温柔的废话 2020-12-07 22:46

I currently have a regular border. I would like to only have a top and bottom border.

How do I accomplish this?

Using the UITextField<

11条回答
  •  爱一瞬间的悲伤
    2020-12-07 23:34

    I will suggest you put one view on the left side of the textfield and one view on the right side of the textfield to cover the left/right border.

    UIView *v1 = [[UIView all] initWithFrame:CGRectMake(textfield.frame.origin.x - 5, textfield.frame.origin.y, 10, textifield.frame.size.height)];
    UIView *v2 = [[UIView all] initWithFrame:CGRectMake(textfield.frame.origin.x + textfield.frame.size.with - 5, textfield.frame.origin.y, 10, textifield.frame.size.height)];
    

提交回复
热议问题