[英]Background image on iPhone 11 simulator is not appropriate size
尝试这个:
[assembly: ExportRenderer(typeof(YourPage), typeof(CustomPage))]
namespace Your.NameSpace.Project.iOS
{
public class CustomPage : PageRenderer
{
public override void ViewWillAppear(bool animated)
{
base.ViewWillAppear(false);
UIGraphics.BeginImageContext(this.View.Frame.Size);
UIImage i = UIImage.FromFile("FileImageBackground.png");
i = i.Scale(this.View.Frame.Size);
this.View.BackgroundColor = UIColor.FromPatternImage(i);
}
}
}
如果您的整个项目使用背景图片替换YourPage
反对Page
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.