Hello everyone, i have found solution, and quite elegant one. It was on my 
table the whole time :), inside of a book, Professional iPhone Programming with 
MonoTouch and .NET/C# by Wallace B McClure, Martin Bowling, Craig Dunn, Chris 
Hardy and Rory Blyth.

So i hope this may help someone, i have found couple solutions on the net but 
they all have some kind  of problems …

So i have UITextView, and the following code in my UIViewController.


NSObject observer1, observer2;

//++++ViewDidLoad++++
//Observing Keyboard notifications-------------------------------------------
//WillShow
observer1 = NSNotificationCenter
        .DefaultCenter
                .AddObserver
                (
                        UIKeyboard.WillShowNotification
                        ,delegate(NSNotification obj) 
                        {
                                var kbdRect = 
UIKeyboard.BoundsFromNotification(obj);
                                var frame = textView.Frame;
                                frame.Height -= kbdRect.Height;
                                textView.Frame = frame;
                        }
                );
//WillHide
observer2 = NSNotificationCenter
        .DefaultCenter
                .AddObserver
                (
                        UIKeyboard.WillHideNotification
                        ,delegate(NSNotification obj) 
                        {
                                var kbdRect = 
UIKeyboard.BoundsFromNotification(obj);
                                var frame = textView.Frame;
                                frame.Height += kbdRect.Height;
                                textView.Frame = frame;
                        
                        }
                );
//---------------------------------------------------------------------------

//++++ViewDidUnload++++ (apparently this is only necessary for iOS versions < 
6.0)
//Unsubscribing from observers------------------------------
NSNotificationCenter.DefaultCenter.RemoveObserver(observer1);
NSNotificationCenter.DefaultCenter.RemoveObserver(observer1);
//----------------------------------------------------------




On Feb 15, 2013, at 1:13 PM, Iki <i...@holisticware.com> wrote:

> Hi guys,
> 
> the problem is:
> 
> I have UITextView, stretched trough whole screen. When typing eventually text 
> will go behind the keyboard, and the only way for me to scroll it is to press 
> return 20 times or so. 
> Is there any way to accomplish this manually, so that the TextView scroll 
> automatically as i type?
> 
> Thanks for any help guys/gals!
> 
> 

_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to