English 中文(简体)
Preview ListView 下一项/ 设置选择选择失败/ 不工作 / Inhibit 用户滚动列表View
原标题:Advance ListView next item / setSelectionFromTop not working / Inhibit user scrolling ListView

我有一个列表视图, 显示项目列表...... 并非全部, 但都在那里 。 而不是让用户按要求向上滚动 / 向下滚动 / 向上/ 向下 按钮 。 我处理的都很好 ExcEPT 如何推进 ListView 。 说我在查看列表中的项目 3 。 下一个用户点击... 我要让 ListView 向项目 4 前进 。 我正内部跟踪它们正在加增/ 衰减的页面 。 我本来期望找到类似的东西, 但没有运气 。

ListView.MoveNext();

ListView.Move(int);

Per Brayden s suggestion I tried the accepted solution here: Maintain/Save/Rest或e scroll position when returning to a ListView and it did not APPEAR to scroll the list....i.e. it stayed on the first list item. I also tried setSelection.

这是我的代码:

public void btn_NextClick(View vw_Current) 
{
    //increment page count 1
    i_PageTracker ++;
    
    //advance to next rec或d
    //int x = lstvw_LiftData.getFirstVisiblePosition();
    View v = lstvw_LiftData.getChildAt(0);
    int top = (v == null) ? 0 : v.getTop();

    lstvw_LiftData.setSelectionFromTop(i_PageTracker, top);
    //lstvw_LiftData.setSelection(i_PageTracker);
 }

根据Vladimir的成功和我的缺乏, 我想提供一些补充信息 我认为无关紧要,但是...

我扩展了简单编辑程序, 并覆盖了 GEPView 。 我还有一个数据信头, 用数据对象的某些数据来弹出 Text View 。

有趣的是,当我在数据编辑器和装货夹的SetViewvalue的 Get View中设置一个断点时,我们会酌情按下它们。然而,当点击下一个按钮时,我们不会按下它们,如果列表向下一个位置前进,我会预计会按下它们。...嗯,我纳闷...我还有另一个想法...马上回来。

我理解了... 但我不知道该怎么办。看不知道我在做什么,我开枪自杀了。我只想一次看到列表中的一个项目,我不想让用户能够滚动。我所做的就是推翻在数据目录中找到的Count in DataAdapter 并返回一个 1。这个SEEMED是答案,因为只有一个项目表现得很酷!但后来压倒了CEONT 意味着只有一个项目要显示,所以我们永远不能前进... 没有什么可前进的。

So what I want to know is this. How do I keep the user from being able to scroll and f或ce them to use the navigation button. Do I handle the scroll event and return null?

最佳回答

我理解了... 但我不知道该怎么办。看不知道我在做什么,我开枪自杀了。我只想一次看到列表中的一个项目,我不想让用户能够滚动。我所做的就是推翻在数据目录中找到的Count in DataAdapter 并返回一个 1。这个SEEMED是答案,因为只有一个项目表现得很酷!但后来压倒了CEONT 意味着只有一个项目要显示,所以我们永远不能前进... 没有什么可前进的。

所以我想知道的是这个。我如何防止用户能够滚动并迫使他们使用导航按钮。我如何处理滚动事件并返回空吗?

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签