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
554456a9
Commit
554456a9
authored
May 26, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated alignemnts for TextField based on PR 402
parent
29775685
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
Sources/iOS/TextField.swift
+12
-2
No files found.
Sources/iOS/TextField.swift
View file @
554456a9
...
@@ -228,6 +228,13 @@ public class TextField : UITextField {
...
@@ -228,6 +228,13 @@ public class TextField : UITextField {
}
}
}
}
/// Vertical distance for the detailLabel from the divider.
@IBInspectable
public
var
detailVerticalDistanceFromDivider
:
CGFloat
=
8
{
didSet
{
layoutDetailLabel
()
}
}
/// Handles the textAlignment of the placeholderLabel.
/// Handles the textAlignment of the placeholderLabel.
public
override
var
textAlignment
:
NSTextAlignment
{
public
override
var
textAlignment
:
NSTextAlignment
{
get
{
get
{
...
@@ -322,6 +329,9 @@ public class TextField : UITextField {
...
@@ -322,6 +329,9 @@ public class TextField : UITextField {
/// A reference to the visibilityIconButton.
/// A reference to the visibilityIconButton.
public
private(set)
var
visibilityIconButton
:
IconButton
?
public
private(set)
var
visibilityIconButton
:
IconButton
?
/// This property adds a padding to placeholder y position animation
public
var
placeholderVerticalAnimationOffset
:
CGFloat
=
0
/**
/**
An initializer that initializes the object with a NSCoder object.
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
- Parameter aDecoder: A NSCoder instance.
...
@@ -513,7 +523,7 @@ public class TextField : UITextField {
...
@@ -513,7 +523,7 @@ public class TextField : UITextField {
/// Layout the detailLabel.
/// Layout the detailLabel.
public
func
layoutDetailLabel
()
{
public
func
layoutDetailLabel
()
{
let
h
:
CGFloat
=
nil
==
detail
?
12
:
detailLabel
.
font
.
stringSize
(
detail
!
,
constrainedToWidth
:
Double
(
width
))
.
height
let
h
:
CGFloat
=
nil
==
detail
?
12
:
detailLabel
.
font
.
stringSize
(
detail
!
,
constrainedToWidth
:
Double
(
width
))
.
height
detailLabel
.
frame
=
CGRectMake
(
0
,
divider
.
frame
.
origin
.
y
+
8
,
width
,
h
)
detailLabel
.
frame
=
CGRectMake
(
0
,
divider
.
frame
.
origin
.
y
+
detailVerticalDistanceFromDivider
,
width
,
h
)
}
}
/// Layout the clearIconButton.
/// Layout the clearIconButton.
...
@@ -560,7 +570,7 @@ public class TextField : UITextField {
...
@@ -560,7 +570,7 @@ public class TextField : UITextField {
v
.
placeholderLabel
.
frame
.
origin
.
x
=
v
.
width
-
v
.
placeholderLabel
.
frame
.
width
v
.
placeholderLabel
.
frame
.
origin
.
x
=
v
.
width
-
v
.
placeholderLabel
.
frame
.
width
default
:
break
default
:
break
}
}
v
.
placeholderLabel
.
frame
.
origin
.
y
=
-
v
.
placeholderLabel
.
frame
.
size
.
height
v
.
placeholderLabel
.
frame
.
origin
.
y
=
-
v
.
placeholderLabel
.
frame
.
size
.
height
+
v
.
placeholderVerticalAnimationOffset
v
.
placeholderLabel
.
textColor
=
v
.
placeholderActiveColor
v
.
placeholderLabel
.
textColor
=
v
.
placeholderActiveColor
}
}
})
{
[
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