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
71482c7e
Commit
71482c7e
authored
Apr 13, 2016
by
Ramon Vicente
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue #301
parent
e3e37a1a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
16 deletions
+26
-16
Sources/iOS/TextField.swift
+26
-16
No files found.
Sources/iOS/TextField.swift
View file @
71482c7e
...
@@ -631,22 +631,28 @@ public class TextField : UITextField {
...
@@ -631,22 +631,28 @@ public class TextField : UITextField {
titleLabel
.
frame
=
bounds
titleLabel
.
frame
=
bounds
titleLabel
.
font
=
font
titleLabel
.
font
=
font
titleLabel
.
hidden
=
false
titleLabel
.
hidden
=
false
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
weak
self
]
in
self
.
titleLabel
.
alpha
=
1
if
nil
!=
self
{
self
.
titleLabel
.
transform
=
CGAffineTransformScale
(
self
.
titleLabel
.
transform
,
0.75
,
0.75
)
self
!.
titleLabel
.
alpha
=
1
self
.
titleLabel
.
frame
=
CGRectMake
(
0
,
-
(
self
.
titleLabelAnimationDistance
+
h
),
self
.
bounds
.
width
,
h
)
self
!.
titleLabel
.
transform
=
CGAffineTransformScale
(
self
!.
titleLabel
.
transform
,
0.75
,
0.75
)
self
!.
titleLabel
.
frame
=
CGRectMake
(
0
,
-
(
self
!.
titleLabelAnimationDistance
+
h
),
self
!.
bounds
.
width
,
h
)
}
})
})
}
}
}
}
/// Hides and animates the titleLabel property.
/// Hides and animates the titleLabel property.
private
func
hideTitleLabel
()
{
private
func
hideTitleLabel
()
{
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
weak
self
]
in
self
.
titleLabel
.
transform
=
CGAffineTransformIdentity
if
nil
!=
self
{
self
.
titleLabel
.
frame
=
self
.
bounds
self
!.
titleLabel
.
transform
=
CGAffineTransformIdentity
})
{
[
unowned
self
]
_
in
self
!.
titleLabel
.
frame
=
self
!.
bounds
self
.
placeholder
=
self
.
placeholderText
}
self
.
titleLabel
.
hidden
=
true
})
{
[
weak
self
]
_
in
if
nil
!=
self
{
self
!.
placeholder
=
self
!.
placeholderText
self
!.
titleLabel
.
hidden
=
true
}
}
}
}
}
...
@@ -657,9 +663,11 @@ public class TextField : UITextField {
...
@@ -657,9 +663,11 @@ public class TextField : UITextField {
let
h
:
CGFloat
=
ceil
(
v
.
font
.
lineHeight
)
let
h
:
CGFloat
=
ceil
(
v
.
font
.
lineHeight
)
v
.
frame
=
CGRectMake
(
0
,
bounds
.
height
+
lineLayerDistance
,
bounds
.
width
,
h
)
v
.
frame
=
CGRectMake
(
0
,
bounds
.
height
+
lineLayerDistance
,
bounds
.
width
,
h
)
v
.
hidden
=
false
v
.
hidden
=
false
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
weak
self
]
in
v
.
frame
.
origin
.
y
=
self
.
frame
.
height
+
self
.
lineLayerDistance
+
self
.
detailLabelAnimationDistance
if
nil
!=
self
{
v
.
alpha
=
1
v
.
frame
.
origin
.
y
=
self
!.
frame
.
height
+
self
!.
lineLayerDistance
+
self
!.
detailLabelAnimationDistance
v
.
alpha
=
1
}
})
})
}
}
}
}
...
@@ -668,9 +676,11 @@ public class TextField : UITextField {
...
@@ -668,9 +676,11 @@ public class TextField : UITextField {
/// Hides and animates the detailLabel property.
/// Hides and animates the detailLabel property.
private
func
hideDetailLabel
()
{
private
func
hideDetailLabel
()
{
if
let
v
:
UILabel
=
detailLabel
{
if
let
v
:
UILabel
=
detailLabel
{
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.15
,
animations
:
{
[
weak
self
]
in
v
.
alpha
=
0
if
nil
!=
self
{
v
.
frame
.
origin
.
y
-=
self
.
detailLabelAnimationDistance
v
.
alpha
=
0
v
.
frame
.
origin
.
y
-=
self
!.
detailLabelAnimationDistance
}
})
{
_
in
})
{
_
in
v
.
hidden
=
true
v
.
hidden
=
true
}
}
...
...
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