[英]How can i scroll to the bottom of the fragment on a nestedScrollView?
I have a fragment
with a nestedScrollView with some static information and some LinearLayouts
with visibility GONE . 我有一个带有nestedScrollView的fragment
, 其中包含一些静态信息和一些具有可见性GONE的 LinearLayouts
。
Those LinearLayout
get fills after this fragment
get opened and then I set the visibility of those Layouts on VISIBLE . 在打开该fragment
之后,将对那些LinearLayout
进行填充,然后在VISIBLE上设置这些Layouts的可见性。 I want just to scroll to the bottom of this fragment when this info load. 我只想在加载此信息时滚动到该片段的底部。
I tried with the property descendantFocusability and using the fullscroll function
on this nestedScrollView , but I get no results. 我试图与物业descendantFocusability和使用fullscroll function
在这个nestedScrollView,但我没有得到任何结果。
While load the fragment try to call this in onCreateview()
in your fragment for scroll at the bottom. 加载片段时,请尝试在片段的onCreateview()
中调用它,以在底部滚动。
Runnable runnable=new Runnable() {
@Override
public void run() {
scrollView.fullScroll(ScrollView.FOCUS_DOWN);
}
};
scrollView.post(runnable);
Happy coding!! 编码愉快!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.