英文:
How to remove autoscroll, when I typing text in TextInputLayout and TextInputEditText
问题
I tried to remove and request focus when only if I dont typing text - all don't work. How can I fix that?
TextInputLayout and TextInputEditText inserted in recyclerview
英文:
I tried to remove and request focus when only if I dont typing text - all don't work. How can I fix that?
TextInputLayout and TextInputEditText inserted in recyclerview
答案1
得分: 1
以下是已翻译的内容:
我建议,例如这样做:
...
// 在类的顶部
boolean canScrowVertically = true;
...
...
// 初始化 RecyclerView
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
...
...
// 初始化 LinearLayout,并重写 canScrollVertically 方法
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context) {
@Override
public boolean canScrollVertically() {
return canScrowVertically;
}
};
...
...
// 设置管理器
recyclerView.setLayoutManager(layoutManager)
...
然后,您可以操作 canScrowVertically
以禁用/启用滚动。
英文:
I would suggest for example to do something like this:
...
// at the top of the class
boolean canScrowVertically = true;
...
...
// init recycler
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
...
...
// Init linerLayout and override canScrollVertically method
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context) {
@Override
public boolean canScrollVertically() {
return canScrowVertically;
}
};
...
...
// Set the manager
recyclerView.setLayoutManager(layoutManager)
...
Then you can manipulate canScrowVertically
to disable/enable the scrow.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论