К сожалению, свойство Цвет контура фрейма не работает на Android.
Но вы можете просто добавить собственный рендерер в ваш проект Android, чтобы он работал.
Вот код:
[assembly: ExportRenderer(typeof(Frame), typeof(OutlinedFrameRenderer))]
namespace haveThat.Droid.CustomDroid
{
public class OutlinedFrameRenderer : FrameRenderer
{
public OutlinedFrameRenderer(Context context) : base(context)
{
}
protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
base.OnElementChanged(e);
}
public override void Draw(Canvas canvas)
{
base.Draw(canvas);
using (var paint = new Paint { AntiAlias = true })
using (var path = new Path())
using (Path.Direction direction = Path.Direction.Cw)
using (Paint.Style style = Paint.Style.Stroke)
using (var rect = new RectF(0, 0, canvas.Width, canvas.Height))
{
float px = Forms.Context.ToPixels(Element != null ? Element.CornerRadius : 10); //Default Corner Radius = 10
float py = Forms.Context.ToPixels(Element != null ? Element.CornerRadius : 10); //Default Corner Radius = 10
path.AddRoundRect(rect, px, py, direction);
//Set the Width of the Border here
paint.StrokeWidth = 1f;
paint.SetStyle(style);
//Take OutLineColor from XAML Frame element and set it natively here.
//string FrameBorderColorHex = String.Format("#{0:X2}{1:X2}{2:X2}", (int)(Element.OutlineColor.R * 255), (int)(Element.OutlineColor.G * 255), (int)(Element.OutlineColor.B * 255));
string FrameBorderColorHex = String.Format("#{3:X2}{0:X2}{1:X2}{2:X2}", (int)(Element.OutlineColor.R * 255), (int)(Element.OutlineColor.G * 255), (int)(Element.OutlineColor.B * 255), (int)(Element.OutlineColor.A * 255));
try
{
paint.Color = Android.Graphics.Color.ParseColor(FrameBorderColorHex);
}
catch
{
paint.Color = Android.Graphics.Color.White;
}
canvas.DrawPath(path, paint);
}
}
}
}