Android NestedScrollView has wrong size after app:layout_behavior

后端 未结 4 1364
眼角桃花
眼角桃花 2020-12-13 04:49

Since Google has published the design support library for android, there are many nice things that can be done without implementing custom code. While i\'ve tested the custo

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 05:20

    Workaround

    Before showing my NestedScrollView and after binding the data to the NestedScrollView content, I call the method fullScroll(int direction) of my NestedScrollView instance with the View.FOCUS_UP direction as argument.

    Code example for a fragment:

    NestedScrollView scrollView = (NestedScrollView) getActivity().findViewById(R.id.scroll_view); scrollView.fullScroll(View.FOCUS_UP);

提交回复
热议问题