显示键盘时的 CommandBar 行为
CommandBar Behavior When Keyboard Is Show
我的 UWP 应用中有 CommandBar
:
<Page.BottomAppBar>
<CommandBar x:Name="BottomBar">
<AppBarButton Icon="Save" Label="Save" Click="OnSave"/>
<AppBarButton Icon="Clear" Label="Reset"/>
</CommandBar>
</Page.BottomAppBar>
在Windows Phone 8.1
中,当显示Keyboard
时,如果我按Save
就会执行OnSave
方法。
但是在UWP中,按下保存会隐藏Keyboard
不执行Click
事件。
我希望这个 CommandBar
表现得像 Windows Phone 8.1
。
我没测试过,不过你可以试试 IsTabStop="False":
<AppBarButton Icon="Save" Label="Save" Click="OnSave" IsTabStop="False"/>
我的 UWP 应用中有 CommandBar
:
<Page.BottomAppBar>
<CommandBar x:Name="BottomBar">
<AppBarButton Icon="Save" Label="Save" Click="OnSave"/>
<AppBarButton Icon="Clear" Label="Reset"/>
</CommandBar>
</Page.BottomAppBar>
在Windows Phone 8.1
中,当显示Keyboard
时,如果我按Save
就会执行OnSave
方法。
但是在UWP中,按下保存会隐藏Keyboard
不执行Click
事件。
我希望这个 CommandBar
表现得像 Windows Phone 8.1
。
我没测试过,不过你可以试试 IsTabStop="False":
<AppBarButton Icon="Save" Label="Save" Click="OnSave" IsTabStop="False"/>