我无法访问在 app.xaml 中创建的静态资源。 这是我的 app.xaml 代码
<Application.Resources>
<ResourceDictionary>
<Color x:Key="AppDefaultColor">#07bab7</Color>
<Color x:Key="PageDefaultColor">#f0f0f0</Color>
</ResourceDictionary>
</Application.Resources>
当我尝试在我的页面中将其用作静态资源时,它会出错。 这是我用来从 app.xaml 访问静态资源的页面代码
<Label Text="Test" TextColor="{StaticResource AppDefaultColor}" />
最佳答案
关于xaml - 无法从 app.xaml 访问 Xamarin Forms 中的 StaticResource,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47709965/