![](/img/trans.png)
[英]Changing the zPosition of the collectionView cell in tvOS in Swift
[英]Changing the zPosition of searchResultsTableView
我有一个UISearchBar
可以动态显示列表中的匹配结果,但是却遇到了噩梦,试图阻止searchResultsTableView
结果UIView
,当点击结果时, UIView
从右侧动画。
洋红色视图(包括其阴影子视图)和纯黑色视图应在列表上方。
我试过了…
self.searchDisplayController.searchResultsTableView.layer.zPosition = 0;
recipeMeasuresView.layer.zPosition = 1;
recipeListView.layer.zPosition = 2;
…但是它弄乱了所附加的手势,仍然没有以正确的顺序显示视图。 我也尝试过...
[self.view sendSubviewToBack:_searchBar];
[ingredientListView bringSubviewToFront:ingredientListView];
……仍然没有喜悦。 顺便说一句,除其他外,我还要添加[_searchBar resignFirstResponder];
给我
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
我是一名目标C新手,因此非常感谢所有帮助。
万一其他人遇到类似问题时searchDisplayController
发现此问题,似乎是由于searchDisplayController
在堆栈顶部添加了自己的视图,因此掩盖了添加到情节提要中的所有内容。
因为没有其他视图控制器添加了searchDisplayResultsTable
,所以searchDisplayResultsTable
上下推任何东西来更改顺序。
我使用的解决方案是添加以编程方式隐藏的视图,这意味着我可以根据发生的情况将它们作为子视图添加到不同的父视图中。 可能不是最好的解决方案,但它确实起作用了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.