切换按钮和开关有什么区别?由于它们提供相同的功能,使用切换按钮或开关的具体用例是什么?
切换按钮:
开关:
最佳答案
这不仅仅是编码问题,更是用户体验问题。这是我的回答:
该控件的描述如下:
切换是一个按钮:sap.m.ToggleButton
而
switch 是用户输入。 sap.m.Switch
但是,主要区别在于用户体验和使用。
Fiori 指南的内容如下:When to use Switch
- You need to emphasize the On/Off characteristic within a dialog.
- You need to clearly show the mode or state that a setting is in.
- You need a toggle switch for binary settings when changes become effective immediately after the user changes them. For example, if the user needs to set data transmission or accept/reject business objects.
对比
总而言之,我可以说: 开关主要代表一种状态(物理状态,如风扇“开”或“关”) 并且文字不宜太大。
而按钮是一个 Action ,主要是用户执行的动词,这可以是较长的文本,例如“激活”
您可以通过示例进一步了解基于用户体验的差异: Difference between switch and toggle
关于button - 切换按钮和开关的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50525778/