Skip to content

Instantly share code, notes, and snippets.

@rolfbjarne
Created October 20, 2014 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rolfbjarne/d7c3f3eb88c016dbe21d to your computer and use it in GitHub Desktop.
Save rolfbjarne/d7c3f3eb88c016dbe21d to your computer and use it in GitHub Desktop.
diff --git a/TextKitDemo/TextKitDemo/InteractiveTextColoringViewController.cs b/TextKitDemo/TextKitDemo/InteractiveTextColoringViewController.cs
index d7f6dee..7b898ec 100644
--- a/TextKitDemo/TextKitDemo/InteractiveTextColoringViewController.cs
+++ b/TextKitDemo/TextKitDemo/InteractiveTextColoringViewController.cs
@@ -8,6 +8,23 @@ using MonoTouch.CoreText;
namespace TextKitDemo
{
+ [Register("UIPlaceholderTextView")]
+ public class UIPlaceholderTextView : UITextView
+ {
+ public string Placeholder { get; set; }
+
+ public UIPlaceholderTextView()
+ {
+ }
+
+ public UIPlaceholderTextView(IntPtr handle) : base(handle)
+ {
+ }
+ public UIPlaceholderTextView (RectangleF frame, NSTextContainer textContainer) : base (frame, textContainer)
+ {
+ }
+ }
+
/*
* The view controller for the inteactive color sample.
*/
@@ -35,7 +52,7 @@ namespace TextKitDemo
textStorage.AddLayoutManager (layoutManager);
- var newTextView = new UITextView (newTextViewRect, container);
+ var newTextView = new UIPlaceholderTextView (newTextViewRect, container);
newTextView.AutoresizingMask = UIViewAutoresizing.FlexibleHeight | UIViewAutoresizing.FlexibleWidth;
newTextView.ScrollEnabled = true;
newTextView.KeyboardDismissMode = UIScrollViewKeyboardDismissMode.OnDrag;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment