예제 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <Editor> e)
        {
            base.OnElementChanged(e);

            if (Control != null)
            {
                if (PlaceHolderLabel == null)
                {
                    CreatePlaceholder();
                }
            }

            if (e.NewElement != null)
            {
                if (Element is SupportEditor)
                {
                    supportEditor = Element as SupportEditor;

                    if (supportEditor.IsExpandable)
                    {
                        Control.ScrollEnabled = false;
                    }
                    else
                    {
                        Control.ScrollEnabled = true;
                    }
                    if (supportEditor.HasRoundedCorner)
                    {
                        Control.Layer.CornerRadius = 5;
                    }
                    else
                    {
                        Control.Layer.CornerRadius = 0;
                    }
                    Control.InputAccessoryView = new UIView(CGRect.Empty);
                    Control.ReloadInputViews();

                    Control.Layer.CornerRadius = (float)supportEditor.CornerRadius;
                    Control.Layer.BorderWidth  = (float)supportEditor.CornerWidth;
                    Control.Layer.BorderColor  = supportEditor.CornerColor.ToCGColor();
                    InitlizeReturnKey();

                    Control.ShouldChangeText += (textView, range, text) => {
                        //Control.ResignFirstResponder();
                        return(true);
                    };
                }
            }
        }
예제 #2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Editor> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                if (Element is SupportEditor)
                {
                    supportEditor = Element as SupportEditor;

                    GradientDrawable gd = new GradientDrawable();
                    gd.SetCornerRadius((float)supportEditor.CornerRadius);
                    gd.SetStroke((int)supportEditor.CornerWidth, supportEditor.CornerColor.ToAndroid());
                    Control.SetBackground(gd);
                    InitlizeReturnKey();
                }
            }
        }
예제 #3
0
        protected override void OnElementChanged(ElementChangedEventArgs <Editor> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement != null)
            {
                if (Element is SupportEditor)
                {
                    supportEditor = Element as SupportEditor;
                    Control.Layer.CornerRadius = (float)supportEditor.CornerRadius;
                    Control.Layer.BorderWidth  = (float)supportEditor.CornerWidth;
                    Control.Layer.BorderColor  = supportEditor.CornerColor.ToCGColor();
                    InitlizeReturnKey();

                    Control.ShouldChangeText += (textView, range, text) => {
                        //Control.ResignFirstResponder();
                        return(true);
                    };
                }
            }
        }