我正在嘗試在 RadioButton 中設定影像,如https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/radiobutton所示
<RadioButton>
<RadioButton.Content>
<Image Source="icon.png"/>
</RadioButton.Content>
</RadioButton>
但在應用程式中,它只顯示文本“Xamarin.Forms.Image”而不是影像。
怎么了?我只是像示例中那樣做。
uj5u.com熱心網友回復:
請閱讀檔案
但是,在某些平臺上,RadioButton 可以顯示視圖,
和
在 Android 上,RadioButton 物件將顯示已設定為內容的 View 物件的基于字串的表示形式:
uj5u.com熱心網友回復:
你能不能試試這種方式。
<RadioButton Value="test">
<RadioButton.Content>
<StackLayout>
<Image Source="icon.png"
HorizontalOptions="Center"
VerticalOptions="CenterAndExpand" />
<Label Text="test"
HorizontalOptions="Center"
VerticalOptions="End" />
</StackLayout>
</RadioButton.Content>
</RadioButton>
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/432716.html
上一篇:找不到型別“xct:TabView”。確認您沒有丟失程式集參考并且所有參考的程式集都已構建
下一篇:Xamarin.Forms/MAUI中的INotifyPropertyChangedvsBindableObjectvsObservableObject
