Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forms frame isn't the same on iOS

I was using Xamarin Forms to create Android version with frames without any custom renderer of frame, it's fine. But when I use it on iOS, all frames are shadowed and separated to each other, it's weird. Should I make a custom renderer for iOS or it should be the same without any modification?

like image 686
Thinh Pham Hong Avatar asked Dec 14 '15 03:12

Thinh Pham Hong


1 Answers

Yes, the default parameter of Frame is different between android and iOS.

iOS: OutlineColor = Black , Android : OutlineColor = Transparent

iOS: HasShadow = true , Android : HasShadow = false

If you want them to be identical, you should make a class derive from Frame and specify the different property to be the same, and you use this class instead.

public class NeatFrame : Frame
{
    public NeatFrame ()
    {
        this.OutlineColor = Color.Transparent;
        this.HasShadow = false;

        this.HorizontalOptions = LayoutOptions.Fill;
        this.VerticalOptions = LayoutOptions.Fill;
        this.BackgroundColor = Color.Transparent;       
    }
}
like image 172
jojobarcream Avatar answered Sep 26 '22 03:09

jojobarcream