Add bottom line to view in SwiftUI / Swift / Objective-C / Xamarin

前端 未结 22 2328
自闭症患者
自闭症患者 2020-11-27 09:19

I would like to keep the border at the bottom part only in UITextField. But I don\'t know how we can keep it on the bottom side.

Can you please advise m

22条回答
  •  爱一瞬间的悲伤
    2020-11-27 09:53

    you can create one image for bottom border and set it to the background of your UITextField :

     yourTextField.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"yourBorderedImageName"]];
    

    or set borderStyle to none and put image of line exactly equal length to textfield!

提交回复
热议问题