简体   繁体   English

如果在ButtonBar中单击“向下”按钮,则禁用向上状态

[英]Disable up state if clicking Down button in ButtonBar

I am having ButtonBar to navigate through NavigationContent inside ViewStack. 我有ButtonBar来浏览ViewStack内部的NavigationContent。

It all works fine as expected but once we click a selected button second time. 一切都按预期运行,但是一旦我们第二次单击选定的按钮。 In this case the Button state changes to up state and it shows as if no button is selected right now. 在这种情况下,“按钮”状态将更改为“向上”状态,并且显示为好像当前没有选择任何按钮。

I tried to address this issue by modifying ButtonBarButtonSkin for First, middle and last buttons by doing following: Set color for upandselected state to red (the color i set for selected state): 我尝试通过执行以下操作来修改“ First”,“ Middle”和“ Last”按钮的ButtonBarButtonSkin来解决此问题:将upandselected状态的颜色设置为红色(我为选定状态设置的颜色):

color.upAndSelected="0xFF0000"

But it did not help me. 但这并没有帮助我。

How can I: 我怎样才能:

Either set the color for button that is up and selected? 设置为选中按钮的颜色?

Or Not allow ButtonBar to make state up in case the button being pressed is already in down State... ie... allowing clicking for only up state buttons. 或如果所按下的按钮已经处于按下状态,则不允许ButtonBar建立状态...即...仅允许单击向上状态的按钮。

Just solved the problem by setting parameter requireSelection as true: 通过将参数requireSelection设置为true即可解决问题:

requireSelection="true"

PS: Leaving the question alive to help the other nubes like me. PS:让问题活着来帮助像我这样的其他分子。

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

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