コード例 #1
0
        public ComposerView(RectangleF bounds, Composer composer, EventHandler cameraTapped) : base(bounds)
        {
            this.composer = composer;
            textView      = new UITextView(RectangleF.Empty)
            {
                Font = UIFont.SystemFontOfSize(18),
            };

            // Work around an Apple bug in the UITextView that crashes
            if (MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.SIMULATOR)
            {
                textView.AutocorrectionType = UITextAutocorrectionType.No;
            }

            textView.Changed += HandleTextViewChanged;

            charsLeft = new UILabel(RectangleF.Empty)
            {
                Text            = "140",
                TextColor       = UIColor.White,
                BackgroundColor = UIColor.Clear,
                TextAlignment   = UITextAlignment.Right
            };

            toolbar       = new UIToolbar(RectangleF.Empty);
            GpsButtonItem = new UIBarButtonItem(UIImage.FromBundle("Images/gps.png"), style, InsertGeo);
            ShrinkItem    = new UIBarButtonItem(UIImage.FromBundle("Images/arrows.png"), style, OnShrinkTapped);

            toolbar.SetItems(new UIBarButtonItem [] {
                new UIBarButtonItem(UIBarButtonSystemItem.Trash, delegate { textView.Text = ""; })
                {
                    Style = style
                },
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace, null),
                ShrinkItem,
                new UIBarButtonItem(UIBarButtonSystemItem.Search, delegate { if (LookupUserRequested != null)
                                                                             {
                                                                                 LookupUserRequested();
                                                                             }
                                    })
                {
                    Style = style
                },
                new UIBarButtonItem(UIBarButtonSystemItem.Camera, cameraTapped)
                {
                    Style = style
                },
                GpsButtonItem
            }, false);

            AddSubview(toolbar);
            AddSubview(textView);
            AddSubview(charsLeft);
        }
コード例 #2
0
ファイル: Composer.cs プロジェクト: nagyist/TweetStation
        public ComposerView(RectangleF bounds, Composer composer, EventHandler cameraTapped)
            : base(bounds)
        {
            this.composer = composer;
            textView = new UITextView (RectangleF.Empty) {
                Font = UIFont.SystemFontOfSize (18),
            };

            // Work around an Apple bug in the UITextView that crashes
            if (MonoTouch.ObjCRuntime.Runtime.Arch == MonoTouch.ObjCRuntime.Arch.SIMULATOR)
                textView.AutocorrectionType = UITextAutocorrectionType.No;

            textView.Changed += HandleTextViewChanged;

            charsLeft = new UILabel (RectangleF.Empty) {
                Text = "140",
                TextColor = UIColor.White,
                BackgroundColor = UIColor.Clear,
                TextAlignment = UITextAlignment.Right
            };

            toolbar = new UIToolbar (RectangleF.Empty);
            GpsButtonItem = new UIBarButtonItem (UIImage.FromBundle ("Images/gps.png"), style, InsertGeo);
            ShrinkItem = new UIBarButtonItem (UIImage.FromBundle ("Images/arrows.png"), style, OnShrinkTapped);

            toolbar.SetItems (new UIBarButtonItem [] {
                new UIBarButtonItem (UIBarButtonSystemItem.Trash, delegate { textView.Text = ""; } ) { Style = style },
                new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace, null),
                ShrinkItem,
                new UIBarButtonItem (UIBarButtonSystemItem.Search, delegate { if (LookupUserRequested != null) LookupUserRequested (); }) { Style = style },
                new UIBarButtonItem (UIBarButtonSystemItem.Camera, cameraTapped) { Style = style },
                GpsButtonItem }, false);

            AddSubview (toolbar);
            AddSubview (textView);
            AddSubview (charsLeft);
        }
コード例 #3
0
ファイル: Composer.cs プロジェクト: kangaroo/TweetStation
        public ComposerView(RectangleF bounds, Composer composer)
            : base(bounds)
        {
            this.composer = composer;
            textView = new UITextView (RectangleF.Empty) {
                Font = UIFont.SystemFontOfSize (18)
            };
            textView.Changed += HandleTextViewChanged;

            charsLeft = new UILabel (RectangleF.Empty) {
                Text = "140",
                TextColor = UIColor.White,
                BackgroundColor = UIColor.Clear,
                TextAlignment = UITextAlignment.Right
            };

            toolbar = new UIToolbar (RectangleF.Empty);
            GpsButtonItem = new UIBarButtonItem (UIImage.FromFile ("Images/gps.png"), style, InsertGeo);
            ShrinkItem = new UIBarButtonItem (UIImage.FromFile ("Images/arrows.png"), style, OnShrinkTapped);

            toolbar.SetItems (new UIBarButtonItem [] {
                new UIBarButtonItem (UIBarButtonSystemItem.Trash, delegate { textView.Text = ""; } ) { Style = style },
                new UIBarButtonItem (UIBarButtonSystemItem.FlexibleSpace, null),
                ShrinkItem,
                new UIBarButtonItem (UIBarButtonSystemItem.Search, delegate { if (LookupUserRequested != null) LookupUserRequested (); }) { Style = style },
                new UIBarButtonItem (UIBarButtonSystemItem.Camera, delegate { CameraButtonTouched (); } ) { Style = style },
                GpsButtonItem }, false);

            AddSubview (toolbar);
            AddSubview (textView);
            AddSubview (charsLeft);
        }