android - 如何检测 Android 中的 i18N UI 问题

标签 android testing user-interface robotium robolectric

您使用什么样的工具和技术来检测 android 中国际化应用程序的 UI 问题?我们知道像德语这样的语言比英语占用更多空间,这可能会导致应用程序用户界面出现对齐、溢出等问题,我们如何检测到这一点??

举个例子:

2 text View in English

2 文本英文查看

enter image description here

相同的德语 TextView

在德语中,用户界面已更改。 1 如何检测到这种变化??

最佳答案

你可以使用这个:

public boolean searchText(String text,
                 int minimumNumberOfMatches,
                 boolean scroll,
                 boolean onlyVisible)
Searches for the specified text and returns true if the searched text is found a specified number of times.
Parameters:
text - the text to search for. The parameter will be interpreted as a regular expression.
minimumNumberOfMatches - the minimum number of matches expected to be found. 0 matches means that one or more matches are expected to be found
scroll - true if scrolling should be performed
onlyVisible - true if only texts visible on the screen should be searched
Returns:
true if text is found a specified number of times and false if the text is not found

如果您使用正确的参数,则当所有字符串未显示时,此指令将返回 false。

第二种解决方案是对所有屏幕进行截图并分析它们以找出布局中的问题。

关于android - 如何检测 Android 中的 i18N UI 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21750554/

相关文章:

android - 如何检测Android设备上的屏幕是否已经打开?

android - 如何在android中调用一个 Activity 的 Intent ?

c++ - 第一次调用 FindWindowEx/EnumChildWindows 后是否缓存了控件树?

java - JScrollpane中自定义滚动条//Java Swing

android - 更新至 Android Studio 3.0。收到 "Kotlin not configured"错误

android - 如何更改 Alertdialog 的背景图像

ruby-on-rails - DRYer 在 factory_girl 中与协会进行测试

testing - FIT 测试中的浮点精度

c - srand() 并生成用于算法测试的数组

java - 选择某些元素后使 Swing JMenuBar 树保持打开状态