简体   繁体   English

Delphi - ListView onItemClick未被触发

[英]Delphi - ListView onItemClick is not being fired

I'm working with a ListView component for both Android and iOS . 我正在为AndroidiOS使用ListView组件。

The onClick event is fired when the user hits the list, however the onItemClick event never occurs (yes, I did test them separately). 当用户点击列表时会触发onClick事件,但onItemClick事件永远不会发生(是的,我确实单独测试过它们)。

I'm also generating the ListItems dynamically, in the simplest way: 我也是以最简单的方式动态生成ListItems

listview_available_gen.Items.Add.Text := 'whythehellyoudontitemclick';

Am I missing something silly? 我错过了一些傻事吗?

I'm not sure why onItemClick is not being fired, but I replaced it with onItemClickEx and now it's receiving the event just fine. 我不确定为什么onItemClick没有被触发,但是我用onItemClickEx替换它,现在它接收事件就好了。

Source: http://docwiki.embarcadero.com/Libraries/Berlin/en/FMX.ListView.TListViewBase.OnItemClickEx 来源: http//docwiki.embarcadero.com/Libraries/Berlin/en/FMX.ListView.TListViewBase.OnItemClickEx

Check that your onItemClick event on ListView is really pointing to the same procedure as in your code. 检查ListView上的onItemClick事件是否真的指向与代码中相同的过程。 Double click the OnItemClick in ListView Events page and it will move you to the procedure which it created or if there is none it will create new one. 双击ListView Events页面中的OnItemClick ,它将移动到它创建的过程,如果没有,它将创建新的过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM