Closed saltyskip closed 7 years ago
@saltyskip could that be why I can't set the placeholder's insets via the following methods?
override func textRect(forBounds bounds: CGRect) -> CGRect
override func editingRect(forBounds bounds: CGRect) -> CGRect
override func placeholderRect(forBounds bounds: CGRect) -> CGRect
I removed drawPlaceholder(in rect: CGRect)
in a fork and now the placeholder is "doubled" in a weird way (one is at desired inset 10 and the other is at inset 0, example placeholder being YY
).
Hi, the reason for drawPlaceholder to be overridden with an empty function body was what @KarlHarnois mentioned:
Without this override, the placeholder is drawn twice on the text field. When running your branch, you'll notice that some placeholders occasionally appear darker than they should due to this issue.
@KarlHarnois : In order to create leading/trailing insets for the text field content, you can use imageViewLeadingInset
, imageViewTrailingInset
, accessoryButtonLeadingInset
, accessoryButtonTrailingInset
which create some padding around the card image view and accessory button respectively.
Issue with duplicated placeholders.
@KarlHarnois Do you find any method find placeholder insets? I am having the same issue, with above method not able to set placeholder insets
Currently the library is trying to draw placeholders twice. The empty function drawPlaceholders rewrites the placeholder to empty. This PR removes the drawing over