Disable blinking cursor in UITextField?

前端 未结 10 1122
日久生厌
日久生厌 2020-12-24 06:31

I\'ve followed the instructions here and succesfully set up a UITextField that gets updated with a UIDatePicker. However the cursor in the UITextField is blinking, which see

10条回答
  •  甜味超标
    2020-12-24 06:45

    I hope it will helpful to you.

    Set Cursor UIColor -> Empty.

     [[self.textField valueForKey:@"textInputTraits"] setValue:[UIColor clearColor] forKey:@"insertionPointColor"];
    

    In Swift : 2.3

    self.textField.valueForKey("textInputTraits")?.setValue(UIColor.clearColor() , forKey:"insertionPointColor")
    

提交回复
热议问题