示例#1
0
        private void DrawBorder(BorderEntry view)
        {
            GradientDrawable gd = new GradientDrawable();

            gd.SetStroke((int)view.BorderWidth * 2, view.BorderColor.ToAndroid());
            gd.SetCornerRadius((float)view.BorderRadius);
            Control.SetBackground(gd);
        }
 private void SetIcon(BorderEntry view)
 {
     if (!string.IsNullOrEmpty(view.Icon))
     {
         Control.LeftViewMode = UITextFieldViewMode.Always;
         Control.LeftViewRect(new CGRect(5, 5, 5, 5));
         Control.LeftView = new UIImageView(UIImage.FromBundle(view.Icon));
     }
     else
     {
         Control.LeftViewMode = UITextFieldViewMode.Never;
         Control.LeftView     = null;
     }
 }
示例#3
0
 private void SetIcon(BorderEntry view)
 {
     if (!string.IsNullOrEmpty(view.Icon))
     {
         try
         {
             var context = Context;
             var resId   = context.Resources.GetIdentifier(System.IO.Path.GetFileNameWithoutExtension(view.Icon),
                                                           "drawable", context.PackageName);
             if (resId != 0)
             {
                 Control.SetCompoundDrawablesWithIntrinsicBounds(resId, 0, 0, 0);
                 Control.CompoundDrawablePadding = 15;
             }
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
             throw;
         }
     }
 }
示例#4
0
 private void DrawBorder(BorderEntry view)
 {
     Control.BorderThickness = new Windows.UI.Xaml.Thickness(1.0, 1.0, 1.0, 1.0);
     Control.BorderBrush     = new SolidColorBrush(Colors.Black);
 }