hover
类: matlab.uitest.TestCase
命名空间: matlab.uitest
对 UI 组件执行悬停手势
说明
输入参数
testCase
— 测试用例
matlab.uitest.TestCase
对象
测试用例,指定为 matlab.uitest.TestCase
对象。
location
— 悬停位置
1×2 或 1×3 数值数组
悬停位置,指定为悬停点的坐标:
坐标区和 UI 坐标区 - 1×2 或 1×3 数值数组,其中包含 x、y 以及可选的 z 坐标。
极坐标区 - 1×2 数值数组,其中包含 θ 和 r 坐标。
面板和 UI 图窗 - 1×2 数值数组,其中包含 x 和 y 坐标。指定悬停点的坐标,以组件左下角为起点测量(以像素为单位)。
示例: [32.5 13 0.25](UI 坐标区)
示例: [pi/2 0.5](极坐标区)
示例: [100 200](UI 图窗)
示例
在 UI 坐标区对象上悬停
创建一个 UI 坐标区和一个交互式测试用例实例。
uiAx = uiaxes; testCase = matlab.uitest.TestCase.forInteractiveUse;
悬停在坐标区坐标 (0.2, 0.4) 定义的点上。
testCase.hover(uiAx,[0.2 0.4])
在 UI 图窗对象上悬停
创建一个 UI 图窗和一个交互式测试用例实例。
uiFig = uifigure; testCase = matlab.uitest.TestCase.forInteractiveUse;
悬停在由像素坐标 (100, 200) 定义的点上。
testCase.hover(uiFig,[100 200])
版本历史记录
在 R2019a 中推出MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)