2016-07-24 10 views
1

Ich würde gerne wissen, ob es möglich ist, etwas mit Xamarin.Forms zu tun.Zeichnen Sie ein Polygon mit Xamarin.forms

enter image description here

ich bereits meine Layout wie diese seprate aber ich frage mich, wie kann ich ein Polygon zeichnen tun? Oder gibt es einen anderen Weg, dies zu erreichen? Ein besserer Weg wie ein Drawable? Aber es muss auf jedem Gerät das gleiche sein ...

// Relative Layouts 
this.contentLayout = new RelativeLayout(); 
this.topLayout = new RelativeLayout(); 
this.bottomLayout = new RelativeLayout(); 

//topLayout.BackgroundColor = Color.FromHex("#00162E"); 
//bottomLayout.BackgroundColor = Color.FromHex("#FFFFFF"); 

// Top and Bottom Layouts 
this.contentLayout.Children.Add(
    topLayout, 
    Constraint.RelativeToParent((parent) => { return 0; }), 
    Constraint.RelativeToParent((parent) => { return 0; }), 
    Constraint.RelativeToParent((parent) => { return parent.Width; }), 
    Constraint.RelativeToParent((parent) => { return (parent.Height/2.5); }) 
); 
this.contentLayout.Children.Add(
    bottomLayout, 
    Constraint.RelativeToParent((parent) => { return 0; }), 
    Constraint.RelativeToParent((parent) => { return this.topLayout.Height; }), 
    Constraint.RelativeToParent((parent) => { return parent.Width; }), 
    Constraint.RelativeToParent((parent) => { return (parent.Height/1.5); }) 
); 

// Inside Top Layout 
// ??? Draw Polygon 

// Inside Bottom Layout 

Danke allen!

Einen schönen Tag noch!

Antwort

1

Werfen Sie einen Blick auf NControl. Ich habe es noch nicht selbst benutzt, aber Sie sollten in der Lage sein, das Look and Feel zu erreichen, das Sie suchen.

Es ist ein Wrapper um NGraphics, der viele Formen unterstützt, einschließlich Pfade.

Verwandte Themen