什么是Android的“提取文字用户界面"? [英] What's the Android "Extracted Text UI"?

查看:77
本文介绍了什么是Android的“提取文字用户界面"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近遇到了一个错误,即我的小型EditText膨胀起来以填充软键盘未占用的任何空间.但仅在横向模式下.

I recently had a bug where my small EditText was ballooning up to fill whatever space wasn't consumed by the soft keyboard. But only in Landscape mode.

我张贴了这篇文章,并从一个有用的StackOverflow成员那里得到了快速响应,我需要添加 android:imeOptions ="flagNoExtractUi" ,所以我做到了,而且奏效了!

I posted this and got a quick response from a helpful StackOverflow member that I needed to add android:imeOptions="flagNoExtractUi", so I did and it worked!

但是我还是不明白.该文档说它是用于指定IME不需要显示其提取的文本UI" 好的,那是什么? http://developer.android.com 的搜索开发人员文档"功能显示短语提取文本UI"在他们的文档中使用了34次,但我没有注意到定义.

But I still don't understand it. The documentation says that it's "Used to specify that the IME does not need to show its extracted text UI" OK, what's that? The "search developer docs" feature of http://developer.android.com shows the phrase "Extracted text UI" used 34 times in their documentation but I didn't notice a definition.

有人可以解释一下它是什么,以及为什么它只影响风景模式吗?预先感谢.

Could someone please explain what it is, and why it only affects Landscape mode? Thanks in advance.

推荐答案

当您在应用程序的TextView中使用该标志时,当它处于全屏"状态时,它将禁止在IME顶部创建一个ExtractedTextView.模式.在全屏"模式下,允许键盘(IME)填充屏幕并覆盖用户尝试编辑的应用程序的TextView.如果要求全屏显示,则会显示全屏.此ExtractedTextView框显示在目标TextView中显示的相同提示,并让用户查看其编辑进度.该标志告诉IME不要生成ExtractedTextView,这可能会在键盘顶部留出一些空间以在应用程序中查看原始的TextView.

When you use that flag in a TextView in your app , it suppresses the creation of an ExtractedTextView at the top of the IME when it is in "full screen" mode. When in "full screen" mode, the keyboard (the IME) is allowed to fill the screen and cover the app's TextView which the user is trying to edit. If it asks for the full screen, it'll be given to it. This ExtractedTextView box shows the same hints appearing in the targeted TextView, and let's the user see their editing progress. That flag tells the IME not to generate the ExtractedTextView which might leave some room at the top of the keyboard to see your original TextView in the app.

在横向模式"下,IME(键盘)的默认实现进入全屏模式.在人像模式"下为常规尺寸(约为屏幕高度的1/3?).默认情况下,除非您取消压缩,否则ExtractedTextView是为全屏"模式生成的.我怀疑当您看到EditText是"balloning"时,实际上是在看全屏"模式键盘的ExtractedTextView.

The default implementation of an IME (keyboard) goes to full screen mode when in "landscape mode". It's regular size (about 1/3 of the screen height?) in "portrait mode". The ExtractedTextView is generated, by default, for "full screen" mode, unless you suppress it. I suspect that when you see your EditText "balloning", your actually looking at the ExtractedTextView of a "full screen" mode keyboard.

这篇关于什么是Android的“提取文字用户界面"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆