0
這是我的代碼;我想添加引用renderere屬性
<StackLayout>
<StackLayout.BackgroundColor>
<OnPlatform x:TypeArguments="Color" Android="#ff1500" iOS="Transparent"></OnPlatform>
</StackLayout.BackgroundColor>
</StackLayout>
我想補充參考屬性renderere像這樣:
<StackLayout>
<StackLayout.BackgroundColor>
<OnPlatform x:TypeArguments="Color" Android="{controls:GradientColors StartColor="#373737" EndColor="#191919"}" iOS="Transparent"></OnPlatform>
</StackLayout.BackgroundColor>
</StackLayout>
我怎麼辦呢?
你需要創建BindibleProperty –
你能舉個例子嗎?感謝 –
其中之一:https://xamarinhelp.com/bindable-properties-xamarin-forms/如果您需要使用屬性更改顏色,然後綁定道具會做,但如果您還需要使用自定義細節(如漸變等) )然後@JordyDieltjens是對的,你還需要自定義渲染器 –