android:isScrollContainer 有什么作用? [英] What does android:isScrollContainer do?

查看:13
本文介绍了android:isScrollContainer 有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道 android:isScrollCOntainer = (boolean)$(View).setScrollContainer(boolean) 是做什么的吗?

Does anyone know what android:isScrollCOntainer = (boolean) or $(View).setScrollContainer(boolean) do?

起初我认为这将是在 ScrollView 内设置一个视图而不是使用 ScrollView 滚动的答案,但似乎并非如此.

At first I thought this would be the answer to set a View inside a ScrollView NOT to scroll with ScrollView, but it doesn't seem to be the case.

在 Android Developers 上,它说,

On Android Developers it says,

如果视图将用作滚动容器,则设置此项,这意味着它可以调整大小以缩小其整个窗口,以便为输入法留出空间."

"Set this if the view will serve as a scrolling container, meaning that it can be resized to shrink its overall window so that there will be space for an input method. "

谁能解释一下这个描述是什么意思?
在这种情况下什么是滚动容器?
有哪些输入法?

Can anyone kindly explain what this description means?
What is a scrolling container in this case?
What kind of input method is available?

推荐答案

滚动容器是容器的大小与其内容无关的容器.例如,您可以制作高度为 100 像素的 ScrollViewListView,但您可以根据需要容纳尽可能多的内容.同样,无论视图中内容的大小如何,您都可以将视图的大小设置为任何您想要的大小.

A scrolling container is one where the size of the container is independent of it's content. For instance you can make a ScrollView or ListView of height 100 pixels, but you can fit as much content in as you want. Similarly regardless of the size of the content in the view, you can set the size the of the View to whatever you'd like.

如果一个容器是可滚动的,那么 Android 就知道它可以缩小容器的大小,而不会使容器的部分内容无法访问(因为用户可以向下滚动以查看屏幕上没有的内容).它在 SoftKeyboard 被打开时使用它 - 如果一个容器是可滚动的,它将尽可能地缩小它以试图将所有元素保留在屏幕上.

If a container is scrollable, then Android knows it can shrink the size of the container without rendering parts of the content of the container inaccessible (since the user can just scroll down to see things not on screen). It uses this for when the SoftKeyboard is opened - if a container is scrollable it will shrink it as much as possible in an attempt to keep all of the elements on screen.

所以ScrollViewListViewGridView等都是滚动容器的例子.

So ScrollView, ListView, GridView etc are all examples of scrolling containers.

这篇关于android:isScrollContainer 有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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