xamarin.forms - Xamarin.Forms 如何在 App 的所有页面上添加背景图片
问题描述
我需要添加一个背景图像并为其设置样式。该图像必须在我的应用程序的所有页面中继承。如何在资源字典的 App.xaml 中添加?
解决方案
在您的 App.xaml 中添加如下样式:
<Style ApplyToDerivedTypes="True" TargetType="Page">
<Setter Property="BackgroundImage" Value="ImageResource.png" />
</Style>
对于其他所有样式,您需要为此添加更多内容。
此外,如果您只需要应用ContentPage
它,它将替换Page
上述样式中的
推荐阅读
- python - 与 MongoDB 搜索相比,在巨大的列表中搜索非常慢
- python - Python Beautifulsoup 找不到 HTML 数据的文本
- powershell - 必须是一种更清洁的方式
- docker - 无法解析主机:Docker for Mac
- java - 如何停止从 Maven 扩展构建
- api - API 服务如何限制没有密钥的调用?
- javascript - 在 .submit() 和 fetch(method: 'POST') 之后使用 GET 请求刷新页面
- flutter - 获得未来
来自 RangeSlider 中的异步函数 - css - 你如何让引导列连续滚动而不是换行
- filepond - Filepond 预览 Excel 上传