-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for iPhones 6 features
- Loading branch information
Mike James
committed
Feb 10, 2016
1 parent
1012bd5
commit d61e436
Showing
30 changed files
with
882 additions
and
785 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using CoreGraphics; | ||
using Foundation; | ||
using UIKit; | ||
|
||
namespace BeerDrinkin.iOS.CustomControls | ||
{ | ||
[Register("PlaceholderTextView")] | ||
public class PlaceholderTextView : UITextView | ||
{ | ||
/// <summary> | ||
/// Gets or sets the placeholder to show prior to editing - doesn't exist on UITextView by default | ||
/// </summary> | ||
public string Placeholder { get; set; } | ||
|
||
public PlaceholderTextView () | ||
{ | ||
Initialize (); | ||
} | ||
|
||
public PlaceholderTextView (CGRect frame) | ||
: base(frame) | ||
{ | ||
Initialize (); | ||
} | ||
|
||
public PlaceholderTextView (IntPtr handle) | ||
: base(handle) | ||
{ | ||
Initialize (); | ||
} | ||
|
||
void Initialize () | ||
{ | ||
Placeholder = "Write a comment"; | ||
|
||
ShouldBeginEditing = t => { | ||
if (Text == Placeholder) | ||
Text = string.Empty; | ||
|
||
return true; | ||
}; | ||
ShouldEndEditing = t => { | ||
if (string.IsNullOrEmpty (Text)) | ||
Text = Placeholder; | ||
|
||
return true; | ||
}; | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.