我的单选按钮的自定义渲染器是,
public class RadioButtonRenderer:ViewRenderer {
protected override void OnElementChanged(ElementChangedEventArgs<CustomRadioButton> e)
{
base.OnElementChanged(e);
if (e.OldElement != null)
{
e.OldElement.PropertyChanged += ElementOnPropertyChanged;
}
if (this.Control == null)
{
var radButton = new RadioButton(this.Context);
radButton.CheckedChange += radButton_CheckedChange;
this.SetNativeControl(radButton);
}
Control.Text = e.NewElement.Text;
Control.Checked = e.NewElement.Checked;
Element.PropertyChanged += ElementOnPropertyChanged;
}
任何人都可以知道如何在单选按钮和文本之间设置空格。