德尔福XE5 Firemonkey TStringGrid中OnClick事件 [英] Delphi XE5 Firemonkey TStringGrid OnClick event
问题描述
我有Delphi Firemonkey TStringGrid中在Android上一个很奇怪的问题。它看起来像上TStringGrid中的事件在windows和android平台的不同引起的。
例如:在Windows firemonkey应用程序,我有一些列的字符串网格。 TStringGrid中作为只读设置。 OnClick事件我有以下的code:
I have a very strange problem with Delphi Firemonkey TStringGrid on Android. It looks like that events on TStringGrid are triggered differently on windows and android platform. For example: in windows firemonkey application I have a string grid with a few columns. TStringGrid is set as read only. OnClick event I have the following code:
TStringGrid(Sender).Cells[TStringGrid(Sender).ColumnIndex,TStringGrid(Sender).Selected] := 'result';
Android应用程序有exactley相同code OnClick事件
Android application has exactley the same code OnClick event
TStringGrid(Sender).Cells[TStringGrid(Sender).ColumnIndex, TStringGrid(Sender).Selected] := 'result';
当我运行Windows应用程序,然后单击字符串网格单元格就被选中,然后'结果'被写在单元格中。
When I run windows application and click on string grid cell it becomes selected and then ‘result’ is written in the cell.
点击之前的Windows
windows before click
点击后窗口
当我运行Android应用程序,并做点击(TAP)发生的事情是'结果'被写在previously选定单元格,而细胞就我没有点击后,被选中。
When I run android application and do click (tap) what happens is that ‘result’ is written in previously selected cell, and after that cell where I did click becomes selected.
安卓前点击
点击后,Android
android after click
我不知道这是Firemonkey或错误预期行为。有没有办法解决这个?
I am not sure is this a bug in Firemonkey or expected behavior. Is there a way to overcome this?
推荐答案
TGrid不移动支持的控制,因此,你应该避免使用它。最好的选择是可能与自定义风格的TListBox。
TGrid is not a supported control on mobile so you should avoid using it. The best alternative is probably a TListBox with a custom style.
这篇关于德尔福XE5 Firemonkey TStringGrid中OnClick事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!