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
030d3fb7
Commit
030d3fb7
authored
Feb 17, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated TextField and TextView with a better fix for the corpping text issue
parent
38e92483
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
13 deletions
+6
-13
Sources/NavigationBarView.swift
+0
-1
Sources/TextField.swift
+4
-7
Sources/TextView.swift
+2
-5
No files found.
Sources/NavigationBarView.swift
View file @
030d3fb7
...
@@ -169,7 +169,6 @@ public class NavigationBarView : MaterialView {
...
@@ -169,7 +169,6 @@ public class NavigationBarView : MaterialView {
}
}
public
override
func
intrinsicContentSize
()
->
CGSize
{
public
override
func
intrinsicContentSize
()
->
CGSize
{
// General alignment.
switch
UIDevice
.
currentDevice
()
.
orientation
{
switch
UIDevice
.
currentDevice
()
.
orientation
{
case
.
LandscapeLeft
,
.
LandscapeRight
:
case
.
LandscapeLeft
,
.
LandscapeRight
:
return
CGSizeMake
(
UIScreen
.
mainScreen
()
.
bounds
.
width
,
44
)
return
CGSizeMake
(
UIScreen
.
mainScreen
()
.
bounds
.
width
,
44
)
...
...
Sources/TextField.swift
View file @
030d3fb7
...
@@ -273,7 +273,7 @@ public class TextField : UITextField {
...
@@ -273,7 +273,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
A property that sets the distance between the textField and
titleLabel.
titleLabel.
*/
*/
public
var
titleLabelAnimationDistance
:
CGFloat
=
4
public
var
titleLabelAnimationDistance
:
CGFloat
=
8
/// An override to the text property.
/// An override to the text property.
public
override
var
text
:
String
?
{
public
override
var
text
:
String
?
{
...
@@ -311,7 +311,7 @@ public class TextField : UITextField {
...
@@ -311,7 +311,7 @@ public class TextField : UITextField {
A property that sets the distance between the textField and
A property that sets the distance between the textField and
detailLabel.
detailLabel.
*/
*/
public
var
detailLabelAnimationDistance
:
CGFloat
=
4
public
var
detailLabelAnimationDistance
:
CGFloat
=
8
/**
/**
:name: detailLabelHidden
:name: detailLabelHidden
...
@@ -334,9 +334,6 @@ public class TextField : UITextField {
...
@@ -334,9 +334,6 @@ public class TextField : UITextField {
}
}
}
}
/// A multiplier for the titleLabel and detailLabel frame height.
public
private(set)
var
scale
:
CGFloat
=
2
/**
/**
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.
...
@@ -528,7 +525,7 @@ public class TextField : UITextField {
...
@@ -528,7 +525,7 @@ public class TextField : UITextField {
v
.
text
=
s
v
.
text
=
s
}
}
}
}
let
h
:
CGFloat
=
v
.
font
.
pointSize
*
scale
let
h
:
CGFloat
=
ceil
(
v
.
font
.
lineHeight
)
v
.
frame
=
CGRectMake
(
0
,
-
h
,
bounds
.
width
,
h
)
v
.
frame
=
CGRectMake
(
0
,
-
h
,
bounds
.
width
,
h
)
v
.
hidden
=
false
v
.
hidden
=
false
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
...
@@ -555,7 +552,7 @@ public class TextField : UITextField {
...
@@ -555,7 +552,7 @@ public class TextField : UITextField {
private
func
showDetailLabel
()
{
private
func
showDetailLabel
()
{
if
let
v
:
UILabel
=
detailLabel
{
if
let
v
:
UILabel
=
detailLabel
{
if
v
.
hidden
{
if
v
.
hidden
{
let
h
:
CGFloat
=
v
.
font
.
pointSize
*
scale
let
h
:
CGFloat
=
ceil
(
v
.
font
.
lineHeight
)
v
.
frame
=
CGRectMake
(
0
,
bounds
.
height
+
bottomBorderLayerDistance
,
bounds
.
width
,
h
)
v
.
frame
=
CGRectMake
(
0
,
bounds
.
height
+
bottomBorderLayerDistance
,
bounds
.
width
,
h
)
v
.
hidden
=
false
v
.
hidden
=
false
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
...
...
Sources/TextView.swift
View file @
030d3fb7
...
@@ -263,7 +263,7 @@ public class TextView: UITextView {
...
@@ -263,7 +263,7 @@ public class TextView: UITextView {
A property that sets the distance between the textView and
A property that sets the distance between the textView and
titleLabel.
titleLabel.
*/
*/
public
var
titleLabelAnimationDistance
:
CGFloat
=
4
public
var
titleLabelAnimationDistance
:
CGFloat
=
8
/// Placeholder UILabel view.
/// Placeholder UILabel view.
public
var
placeholderLabel
:
UILabel
?
{
public
var
placeholderLabel
:
UILabel
?
{
...
@@ -303,9 +303,6 @@ public class TextView: UITextView {
...
@@ -303,9 +303,6 @@ public class TextView: UITextView {
}
}
}
}
/// A multiplier for the titleLabel and detailLabel frame height.
public
private(set)
var
scale
:
CGFloat
=
2
/**
/**
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.
...
@@ -511,7 +508,7 @@ public class TextView: UITextView {
...
@@ -511,7 +508,7 @@ public class TextView: UITextView {
v
.
text
=
s
v
.
text
=
s
}
}
}
}
let
h
:
CGFloat
=
v
.
font
.
pointSize
*
scale
let
h
:
CGFloat
=
ceil
(
v
.
font
.
lineHeight
)
v
.
frame
=
CGRectMake
(
0
,
-
h
,
bounds
.
width
,
h
)
v
.
frame
=
CGRectMake
(
0
,
-
h
,
bounds
.
width
,
h
)
v
.
hidden
=
false
v
.
hidden
=
false
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
self
]
in
UIView
.
animateWithDuration
(
0.25
,
animations
:
{
[
unowned
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