在RAD Studio在10西雅图,性能和QUOT;。文本"和" .Detail"我的列表视图带有下划线为错误。我该如何解决这个问题? [英] In RAD Studio 10 Seattle, the properties ".Text" and ".Detail" for my ListViews are underlined as errors. How do I fix this?
问题描述
我刚才下载的RAD Studio 10西雅图和打开,我在公司的RAD Studio XE8制定一个方案。在XE8,我的程序绝对没有错误。然而,当我在10西雅图打开程序并试图运行它,它给了我60错误。我看了看我的code和listview.items.item []。文本和listview.items.item []。详细的所有实例都下划线。
当我看着listview.items.item [],的.text和.detail的可能性能都没有了。解决这个问题你怎么解决/获取?
在此先感谢,乔治。
FireMonkey的的 FMX.ListView.TListView
组件及其相关的类都发生在西雅图一个广泛的重构。这是在案英巴卡迪诺的DocWiki:
<一个href=\"http://docwiki.embarcadero.com/RADStudio/Seattle/en/What%27s_New#Refactoring_of_the_List_View_Control\"相对=nofollow>最新消息|列表视图控件的重构
曾经是在TCustomListView许多成员现在正处于一个不同的类,甚至不同的单位。各位,走进一个不同的类继续成为通过继承TCustomListView的一部分。
有关更改的详细列表,请参阅西雅图列表视图控件的重构。
块引用>重构页面没有提及
文本
和详细信息
性质特别。然而,DocWiki的其他页面提供缺少的线索:
现在必须转换 TListView.Selected作为一个 Appearances.TListViewItem 使用它作为这样的。
块引用>FMX.ListView.TListViewBase.Selected
要使用选择为 Appearances.TListViewItem ,必须将它转换为这样的:
德尔福:
SelectedItemText:= TListViewItem(TListView1.Selected)。文本;
C ++
SelectedItemText =((TListViewItem *)(TListView1-&GT;选择)) - &gt;文字;
块引用>的
TListView.Selected
属性仍返回的FMX.ListView.Types.TListItem
如前。然而,TListItem
不再拥有自己的详细信息
和文本
属性。他们已被转移到FMX.ListView .Appearances.TListViewItem
类,它TListItem
派生的。
的TListView
仍的FMX.ListView.TCustomListView
和以前一样,但现在TCustomListView
从一组新的派生未在XE8存在基类:XE8:
FMX.Controls.TStyledControl
结果
↓结果
FMX.ListView.TCustomListView
结果
↓结果
FMX.ListView.TListView
西雅图:
FMX.Controls.TStyledControl
结果
↓结果
FMX.ListView.TAdapterListView
结果
↓结果
FMX.ListView.TListViewBase
结果
↓结果
FMX.ListView.T presentedListView
结果
↓结果
FMX.ListView.TAppearanceListView
结果
↓结果
FMX.ListView.TCustomListView
结果
↓结果
FMX.ListView.TListView
所以,按理说,所有的在
的TListView
列表项的对象现在的情况下,<一个href=\"http://docwiki.embarcadero.com/Libraries/Seattle/en/FMX.ListView.Appearances.TAppearanceListViewItem\"相对=nofollow>FMX.ListView.Appearances.TAppearanceListViewItem
类,它TListViewItem
。因此,您在访问已经从
TListItem
移到TListViewItem
任何财产时,相应的类型转换,其中包括详细信息
和文本
性质,及其他。I have just downloaded RAD Studio 10 Seattle and opened a program that I was developing in RAD Studio XE8. In XE8, my program had absolutely no errors. However, when I opened the program in 10 Seattle and tried to run it, it gave me about 60 errors. I looked at my code and all instances of "listview.items.item[].text" and "listview.items.item[].detail" were underlined. When I looked at the possible properties of "listview.items.item[]", ".text" and ".detail" were not there. How do you fix / get around this problem?
Thanks in advance, George.
解决方案FireMonkey's
FMX.ListView.TListView
component and its related classes have undergone an extensive refactoring in Seattle. This is documented on Embarcadero's DocWiki:What's New | Refactoring of the List View Control
Many members that used to be in TCustomListView are now in a different class or even a different unit. Members that went into a different class continue being a part of TCustomListView through inheritance.
For a detailed list of changes, see Refactoring of the List View Control in Seattle.
The refactoring page does not mention the
Text
andDetail
properties specifically. However, other pages of the DocWiki provide the missing clue:What's New | Other FireMonkey Changes
Now you must cast TListView.Selected as a Appearances.TListViewItem to use it as such.
FMX.ListView.TListViewBase.Selected
To use Selected as an instance of Appearances.TListViewItem, you must cast it as such:
Delphi:
SelectedItemText := TListViewItem(TListView1.Selected).Text;
C++:
SelectedItemText = ((TListViewItem*)(TListView1->Selected))->Text;
The
TListView.Selected
property still returns aFMX.ListView.Types.TListItem
as before. However,TListItem
no longer has its ownDetail
andText
properties. They have been moved to theFMX.ListView.Appearances.TListViewItem
class, which derives fromTListItem
.
TListView
still derives fromFMX.ListView.TCustomListView
as before, but nowTCustomListView
derives from a new set of base classes that did not exist in XE8:XE8:
FMX.Controls.TStyledControl
↓
FMX.ListView.TCustomListView
↓
FMX.ListView.TListView
Seattle:
FMX.Controls.TStyledControl
↓
FMX.ListView.TAdapterListView
↓
FMX.ListView.TListViewBase
↓
FMX.ListView.TPresentedListView
↓
FMX.ListView.TAppearanceListView
↓
FMX.ListView.TCustomListView
↓
FMX.ListView.TListView
So it stands to reason that all list item objects in
TListView
are now instances of theFMX.ListView.Appearances.TAppearanceListViewItem
class, which derives fromTListViewItem
.As such, you have to type-cast accordingly when accessing any property that has moved from
TListItem
toTListViewItem
, which includes theDetail
andText
properties, amongst others.这篇关于在RAD Studio在10西雅图,性能和QUOT;。文本&QUOT;和&QUOT; .Detail&QUOT;我的列表视图带有下划线为错误。我该如何解决这个问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!