使用SG组件(SearchView)是否可以在主场景中观察网格视图



我检查了SearchView中的网格视图。这是布局的子项。但是,有可能观察主场景内部的网格视图吗?我检查了两个字段(rowItemFocused,rowItemSelected(,它总是显示的。网格视图是否可见时。

我打印搜索视图如下所示:

m.searchView : <Component: roSGNode:SearchView> =
{
childRenderOrder: "last"
clippingRect: <Component: roAssociativeArray>
enableRenderTracking: false
inheritParentOpacity: true
inheritParentTransform: true
muteAudioGuide: false
opacity: 1
renderPass: 0
renderTracking: "disabled"
rotation: 0
scale: <Component: roArray>
scaleRotateCenter: <Component: roArray>
translation: <Component: roArray>
visible: true
change: <Component: roAssociativeArray>
focusable: false
focusedChild: <Component: roSGNode:Group>
id: ""
close: false
content: <Component: roInvalid>
errorCode: 0
errorMsg: ""
hintText: "Search here for moviename/releasedate"
noResultsLabelText: "No results"
overhang: <Component: roSGNode:Overhang>
posterShape: "16x9"
query: ""
rowItemFocused: <Component: roArray>
rowItemSelected: <Component: roArray>
rowPosterShapes: <Component: roArray>
saveState: false
showNoResultsLabel: true
showSpinner: false
style: ""
theme: <Component: roAssociativeArray>
updateTheme: invalid
viewContentGroup: <Component: roSGNode:Group>
wasClosed: false
wasShown: true
}

是的,假设你的m.searchView已经从主场景中引用,你可以这样做:

m.searchView.observeField("focusedChild", "onSearchViewFocusChange")
...
sub onSearchViewFocusChange()
if m.searchView.isInFocusChain() =  true
' searchview has focus
else
' searchView lost focus
end if
end sub

如果尚未从主场景中引用m.searchView,则可以在创建引用时找到传递引用的方法。(根据您的问题,我无法确定此架构(

希望这能帮助

相关内容

  • 没有找到相关文章

最新更新