Android:onSizeChanged,一个例子?
当软键盘出现在屏幕上时,我想使用 onSizeChange 来检测 LinearLayout 中的高度差。我想发出 fullScroll(View.FOCUS_DOWN);在那一点上。一个例子将不胜感激。
I want to use onSizeChange to detect the height difference in a LinearLayout when the soft keyboard comes on screen. I want to issue fullScroll(View.FOCUS_DOWN); at that point. An example would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不明白你的问题,但这是一个例子。您已经知道应该使用
onSizeChange
,但是到底在哪里遇到问题呢?SizeChangingLinearLayout
是Activity
的根视图。它仅在键盘打开、横向模式等情况下发生变化。这有帮助吗?
I do not understand your question, but here is an example. You already know that you should use
onSizeChange
, but exactly where do you run into problem?SizeChangingLinearLayout
is the root view of theActivity
. It only changes when the keyboard comes on, on landscape mode, and so on.Does this help?