我在NestedScrollView中有一个GridView。每当GridView的内容发生变化时,我都使用下面的代码来调整GridView的大小。这工作正常,但是当我从应用程序的片段3滑回到片段2(NestedScrollView所在的位置)时,NestedScrollView滚动到最底部。奇怪的是,当从片段1滑动到片段2时不会发生这种情况。在调整GridView大小后,它也不会直接发生。
如何通过滚动到底部来压制NestedScrollView?
C:\Users\gaucho-ucsb>pip install tradingWithPython
Collecting tradingWithPython
Using cached tradingWithPython-3.1.0.0.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\gaucho~1\appdata\local\temp\pip-build-gshhyv\tradingWithPython\setup.py", line 3, in <module>
import tradingWithPython as twp
File "tradingWithPython\__init__.py", line 6, in <module>
from .lib import extra
File "tradingWithPython\lib\extra.py", line 20
print('\r', self, end='')
^
SyntaxError: invalid syntax
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in
c:\users\gaucho~1\appdata\local\temp\pip-build-gshhyv\tradingWithPython\
答案 0 :(得分:117)
将android:descendantFocusability="blocksDescendants"
添加到NestedScrollView
答案 1 :(得分:1)
如果我将 { [Error: connect ETIMEDOUT]
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
source: 'socket' }
添加到GridView的nestedScrollView.scrollTo(0, 0);
方法的末尾,问题就解决了。但是,防止nestedScrollView首先自动滚动会更有意义。
想法?