-2
我需要能够为Android创建一个透明的Xamarin.Forms页面。我怎样才能做到这一点真正的页面渲染器?现在它有一个默认的背景颜色。Xamarin.Forms中的透明页面
[assembly: ExportRenderer(typeof(MyPage), typeof(ClearBackgroundPageRenderer))]
namespace MyApp.Droid
{
public class ClearBackgroundPageRenderer : PageRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
{
base.OnElementChanged(e);
SetBackgroundColor(Color.Transparent.ToAndroid());
}
}
}
欢迎来到[Stack Overflow](http://stackoverflow.com/)!请阅读[如何提问](http://stackoverflow.com/help/how-to-ask)并提供[最小,完整和可验证示例](http://stackoverflow.com/help/mcve) ! –