Swift中的自定义/常用工具栏(Custom/common toolbar in Swift)
我对Swift很新,我正在开发一个我不确定如何设置导航的应用程序。 它适用于标签栏,但我希望条形图显示正在显示的视图。 用户应始终能够访问4个“主要”视图。 当我进入其中一个主要观点的子视图时,问题就来了。
我有标签栏,主视图有4个图标。 它目前正在显示“活动列表”。 当用户单击某个活动时,它将在下一个详细级别显示一个列表。 但是,该视图不是标签栏中显示的主要视图之一,因此它没有标签栏,也无法直接转换到其中一个主视图。 您必须先退回到“活动”列表,然后才能选择其他选项卡。
假设主视图(在标签栏中表示)是A,B,C和D.我希望能够在所有子视图上显示相同的工具栏(例如C-1,C-2等)并允许直接转换到任何其他主视图,而无需用户手动退出每个子视图。
实现这一目标的“最佳”方法是什么? 1)我应该创建一个在每个视图控制器上实现的自定义工具栏对象吗? 2)它应该是标签栏和工具栏的组合吗? 3)如果我已经钻进了一堆视图,在切换到不同的选项卡之前,是否需要单独弹出所有这些视图? 4)我用什么作为“根”视图?
谢谢你的任何建议。 我已经找到了,但还没有找到一个像这样的场景的例子。
I'm quite new to Swift and am working on an app where I'm not sure how to setup the navigation. It works with a tab bar, except that I want the bar to display nomatter what view is being displayed. There are 4 "main" views that the user should always be able to get to. The problem comes when I get into subviews of one of those main views.
I have the tab bar with the 4 icons for the primary views. It's currently displaying the "activity list". When the user clicks on an activity, it will display a list at the next level of detail. However, that view is not one of the primary ones that is represented in the tab bar, so it has no tab bar and no way to transition directly to one of the primary views. You have to back your way out to the Activity list before you can select a different tab.
Say that the main views (represented in the tab bar) are A, B, C, and D. I want to be able to display the same toolbar on all sub-views (e.g. C-1, C-2, etc.) and allow direct transition to any of the other main views, without the user having to manually back out of each sub-view.
What is the "best" way to accomplish this? 1) Should I be creating a custom toolbar object that gets implemented on every view controller? 2) Should it be a combination of tab bar and tool bars? 3) If I have drilled into a stack of views, do I need to pop all of those views individually before I can switch to a different tab? 4) What do I use as my "root" view?
Thanks for any suggestions. I have hunted, but haven't found an example of a scenario quite like this.
原文:https://stackoverflow.com/questions/28800687
最满意答案
一些基本的事情要尝试,
- 确保您首先构建代码。
- 确保你在[TestMethod]内
- 检查班级的顶部是否有[CodedUITest]
- 您是否正在使用所有引用(例如,使用Microsoft.VisualStudio.TestTools.UITesting)
如果它不起作用,请告诉我并尝试获取更多信息。
A few basic things to try,
- Make Sure you build the code first.
- Make sure you are within a [TestMethod]
- Check that the top of your class has [CodedUITest]
- Are you using all your references (eg. using Microsoft.VisualStudio.TestTools.UITesting)
Let me know if it doesn't work and try and get more info.
相关问答
更多-
自己找出了一个解决方案,编写了一个程序,从每个HTML日志中获取节点并将它们合并为一个HTML文件。 奇迹般有效。 Figured out a solution by myself, wrote a program to take thenodes from each HTML log and combine them into a single HTML file. Works like a charm.好吧,我想我明白了。 它看起来像你必须暂停记录,然后单击“生成代码”以使十字线可以选择。 然后你创建你的断言作为一个单独的步骤和“生成代码”。 我不确定这是否是您的工作流应该是,但它始终如一地为我工作。 Ok, I think I figured it out. It looks like you have to pause the recording and then click "Generate Code" to get the crosshairs to be selectable. Then yo ...如果复选框本身没有唯一属性,请指定每个复选框的父对象以区分它们。 例: 对于支持编码UI测试的唯一Visual Studio 2012版本是Premium和Ultimate。 http://www.microsoft.com/visualstudio/eng/products/compare 这些版本应该能够运行您的脚本。 The only versions of Visual Studio 2012 that support Coded UI Testing are Premium and Ultimate. http://www.microsoft.com/visualstud ...
Visual Studio 2012编码的UI测试无法加载包(Visual Studio 2012 Coded UI testing failed to load package)[2022-06-25]
我今天遇到了同样的问题。 我在Visual Studio 2010中有一个现有的应用程序。几个月前我们将它更新到Visual Studio 2012,现在更新1.当我们添加一个编码的ui项目时,我们收到了上面的消息。 该解决方案中的一个项目是mvc 3项目(在Visual Studio 2010中制作并且每次都升级)。 该项目是没有成功创建编码的ui项目的问题。 我们认为这是T4Scaffolding nuget包。 如何修复:使用您的项目重启VS 2012。 卸载您的MVC项目。 添加Coded UI测试 ...问题出在Visual Studio的Update 3上,我删除了更新并修复了Visual Studio 2012,现在正在正确生成文件。 将向Microsoft报告此问题。 The problem is with the Update 3 of Visual Studio, I removed the update and repaired Visual Studio 2012 and the file is now being generated correctly. Will be reporting ...在VS 2012中无法使用Coded UI Test Builder生成GeneratCode(Unable to GeneratCode with Coded UI Test Builder in VS 2012)[2022-03-05]
一些基本的事情要尝试, 确保您首先构建代码。 确保你在[TestMethod]内 检查班级的顶部是否有[CodedUITest] 您是否正在使用所有引用(例如,使用Microsoft.VisualStudio.TestTools.UITesting) 如果它不起作用,请告诉我并尝试获取更多信息。 A few basic things to try, Make Sure you build the code first. Make sure you are within a [TestMethod] Chec ...好吧,我没有直接的方法。 但这个黑客可以帮助你得到你想要的东西.. // Start the Browser As Process to start in Private mode Process browserProcess = new Process(); browserProcess.StartInfo.FileName = "iexplore.exe"; browserProcess.StartInfo.Arguments = ...如何使用UIMap Coded UI Test Builder进行本地测试(How do I use UIMap Coded UI Test Builder for local testing)[2024-03-13]
我是否需要在录制时以调试模式运行我的应用程序? 不可以。您不能使用Visual Studio的调试/发布模式并同时进行记录。 单独启动应用程序。 这具有很大的优势,您可以使用一组测试来测试我们的应用程序的不同版本。 一旦生成测试,是否有任何方式可视地查看正在执行的步骤? 不。你可以从测试运行中获取一个日志,当然你会看到自己的测试运行,但是没有静态图形...说实话我永远不会错过这样的功能。 我应该在开始录制之前打开浏览器,还是应该在我开始浏览页面后这样做? 你可以随意做。 当然你可以记录浏览器的开始。 我们之 ...尝试使用TestContext.Properties["__Tfs_BuildNumber__"].ToString()的值TestContext.Properties["__Tfs_BuildNumber__"].ToString() 。 属性字典中还包含许多其他有用的信息。 值得一看,看看是否有其他有用的东西(例如BuildDirectory ) Try using the value from TestContext.Properties["__Tfs_BuildNumber__"].ToString ...相关文章
更多- 千锋首发Swift视频教程
- Swift入门视频教程-尚学堂视频教程
- iphone上自定义状态栏效果的实现
- Hadoop自定义SdfTextInputFormat用在streaming中
- 2007年9月重灌常用工具軟體
- 微信自定义菜单
- 自定义solr core
- iphone上自定义状态栏效果的实现
- solr 自定义 dismax查询方式
- 顶 微信公众平台自定义菜单创建 -JAVA
最新问答
更多- 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
- 如何通过引用返回对象?(How is returning an object by reference possible?)
- 矩阵如何存储在内存中?(How are matrices stored in memory?)
- 每个请求的Java新会话?(Java New Session For Each Request?)
- css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
- 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
- xcode语法颜色编码解释?(xcode syntax color coding explained?)
- 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
- 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
- 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
- 西安哪有PLC可控制编程的培训
- 在Entity Framework中选择基类(Select base class in Entity Framework)
- 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
- 电脑二级VF有什么用
- Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
- 金华英语角.
- 手机软件如何制作
- 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
- 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
- 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
- Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
- 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
- python的访问器方法有哪些
- DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
- 在Ruby中对组合进行排序(Sorting a combination in Ruby)
- 网站开发的流程?
- 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
- 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
- 透明度错误IE11(Transparency bug IE11)
- linux的基本操作命令。。。