2015-01-21 35 views
1

對於顏色按鈕我用按鈕樣式(顏色)如何更改? Xamarin跨平臺

<Button HorizontalOptions ="StartAndExpand" Image="@+id/table_icon" BackgroundColor="Red"/> 

,但我的應用程序是非常緩慢的。有沒有其他的方法來改變按鈕的顏色。 Style =「」我無法使用,或者不存在於xaml中。 ??

在C#代碼
+0

是否要更改C#代碼中的顏色? – dmSherazi 2015-01-21 11:39:33

+0

是的,但鍵入Button.BackgroundColor = Color.Blue;我的應用很慢。 :O – Ibrahim 2015-01-21 11:43:16

+0

我不知道我理解你的問題。問題是否改變顏色或應用程序的性能不佳? – angak 2015-01-21 12:13:55

回答

-1

嘗試使用

button.BackgroundColor = UIColor.Yellow; 

更改button你的按鈕的參考。

+0

但是,只有這次在C#中再次做同樣的事情不在XAML中。如果你在C#中這樣做會更快。並沒有UIColor.Yellow,更正確的Color.Yellow爲跨平臺 – Ibrahim 2015-01-21 11:44:41