我想以此爲榜樣:如何在Xamarin中創建ResourceDictionary?
public class App : Application
{
public App()
{
var buttonStyle = new Style (typeof(Button)) {
Setters = {
...
new Setter { Property = Button.TextColorProperty, Value = Color.Teal }
}
};
Resources = new ResourceDictionary();
Resources.Add ("buttonStyle", buttonStyle);
...
}
...
}
但它不工作/識別new ResourceDictionary()
。有誰知道我可能會做錯什麼?
定義'不起作用'。你有任何錯誤?如果是,他們是什麼? –
將資源添加到資源字典後,您仍然必須在實際按鈕上設置樣式。例如,使用Xamarin.Forms;'' – Nick
''' – Milen