您使用什么样的工具和技术来检测 android 中国际化应用程序的 UI 问题?我们知道像德语这样的语言比英语占用更多空间,这可能会导致应用程序用户界面出现对齐、溢出等问题,我们如何检测到这一点??
举个例子:
2 文本英文查看
相同的德语 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/