简体   繁体   English

在Xamarin表单中使用C#代码的自定义切换按钮

[英]Custom Toggle Button using c# code in xamarin forms

I need to create custom toggle button using C# code. 我需要使用C#代码创建自定义切换按钮。 Please refer below snap, it should act like a toggle button. 请参考下面的快照,它应该像一个切换按钮。

在此处输入图片说明

If you don't want to use the plugin, you need to perform custom rendering. 如果您不想使用该插件,则需要执行自定义渲染。 https://github.com/chrispellett/Xamarin-Forms-SegmentedControl https://github.com/chrispellett/Xamarin-Forms-SegmentedControl

The above github repository has the source code for custom rendering for segmented button in andorid and ios only not for windows. 上面的github存储库提供了用于andoridios分段按钮的自定义渲染的源代码,仅适用于Windows。

Take a look at SegmentedButtonGroup in FreshEssentials. 看一下FreshEssentials中的SegmentedButtonGroup。 It looks like that is what you need. 看起来这就是您所需要的。

http://www.michaelridland.com/xamarin/freshessentials-for-xamarin-forms-the-must-have-nuget-for-forms/ http://www.michaelridland.com/xamarin/freshessentials-for-xamarin-forms-the-must-have-nuget-for-forms/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM