Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
e0c8eced
Commit
e0c8eced
authored
Oct 08, 2016
by
Mickael GUESDON
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix placeholder missplacement when using left view in textfield
parent
b591c92d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
Sources/iOS/TextField.swift
+7
-3
No files found.
Sources/iOS/TextField.swift
View file @
e0c8eced
...
@@ -437,7 +437,11 @@ open class TextField: UITextField {
...
@@ -437,7 +437,11 @@ open class TextField: UITextField {
/// Layout the placeholderLabel.
/// Layout the placeholderLabel.
open
func
layoutPlaceholderLabel
()
{
open
func
layoutPlaceholderLabel
()
{
if
!
isEditing
&&
true
==
text
?
.
isEmpty
&&
isPlaceholderAnimated
{
if
!
isEditing
&&
true
==
text
?
.
isEmpty
&&
isPlaceholderAnimated
{
placeholderLabel
.
frame
=
bounds
if
let
leftViewWidth
=
self
.
leftView
?
.
frame
.
size
.
width
{
placeholderLabel
.
frame
=
CGRect
(
x
:
leftViewWidth
,
y
:
bounds
.
origin
.
y
,
width
:
bounds
.
size
.
width
-
leftViewWidth
,
height
:
bounds
.
size
.
height
)
}
else
{
placeholderLabel
.
frame
=
bounds
}
}
else
if
placeholderLabel
.
transform
.
isIdentity
{
}
else
if
placeholderLabel
.
transform
.
isIdentity
{
placeholderLabel
.
frame
=
bounds
placeholderLabel
.
frame
=
bounds
placeholderLabel
.
transform
=
CGAffineTransform
(
scaleX
:
0.75
,
y
:
0.75
)
placeholderLabel
.
transform
=
CGAffineTransform
(
scaleX
:
0.75
,
y
:
0.75
)
...
@@ -543,9 +547,9 @@ open class TextField: UITextField {
...
@@ -543,9 +547,9 @@ open class TextField: UITextField {
guard
let
s
=
self
else
{
guard
let
s
=
self
else
{
return
return
}
}
s
.
placeholderLabel
.
transform
=
CGAffineTransform
.
identity
s
.
placeholderLabel
.
transform
=
CGAffineTransform
.
identity
s
.
placeholderLabel
.
x
=
0
s
.
placeholderLabel
.
x
=
s
.
leftView
?
.
frame
.
size
.
width
??
0
s
.
placeholderLabel
.
y
=
0
s
.
placeholderLabel
.
y
=
0
s
.
placeholderLabel
.
textColor
=
s
.
placeholderNormalColor
s
.
placeholderLabel
.
textColor
=
s
.
placeholderNormalColor
})
{
[
weak
self
]
_
in
})
{
[
weak
self
]
_
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment