简体   繁体   English

在ios中将故事板从一个应用程序复制到另一个应用程序的最佳方法是什么?

[英]What is the best way to copy storyboard from one app to another in ios?

I am working on renovating my current IOS project architecture.我正在改造我当前的IOS项目架构。 To move storyboards, I copied the old Main.Storyboard and LaunchScreen.StoryBoard XML to new Main.storyboard and LaunchScreen.StoryBoard XML (Project name was the same).为了移动故事板,我将旧的Main.StoryboardLaunchScreen.StoryBoard XML 复制到新的Main.storyboardLaunchScreen.StoryBoard XML(项目名称相同)。

I also Fixed the localization and assets linking part.我还修复了localizationassets链接部分。 Everything is fine, and after successfully building the project, UI is getting distorted in iPhone 6 and other versions except to iPhone 5 .一切都很好,在成功构建项目后,除了iPhone 5之外, iPhone 6和其他版本的UI越来越扭曲。 I reconfirm the constraint with the old project, and there was no change.我用旧项目再次确认约束,没有任何变化。

The old app is working fine with different-different iPhone screen sizes.旧的应用程序在不同的 iPhone 屏幕尺寸下运行良好。 Is there any right way to copy the storyboard?有没有正确的方法来复制故事板? Or Am I missing something here?或者我在这里遗漏了什么?

Edit-1编辑-1

I think StoryBoard layout size is limited to iphone5 only.我认为StoryBoard布局大小仅限于iphone5

Solution解决方案

在此处输入图片说明

Than browse your StoryBoardName.storyboard file.比浏览您的 StoryBoardName.storyboard 文件。

That'll definitely work including all your constants .这肯定会起作用,包括您的所有常量。

Note : make sure you check copy item if needed when you add you file to protect the original source file.注意:确保在添加文件时根据需要检查复制项目以保护原始源文件。

The way you did it is correct.你这样做的方法是正确的。 You're simply running into the fact that your layout constraints are either non-existant or wrong.您只是遇到了这样一个事实,即您的布局约束不存在或错误。 There's nothing magical about a storyboard...it's just a file like any other you'd copy into your new project.故事板没有什么神奇之处……它只是一个文件,就像您复制到新项目中的任何其他文件一样。

You should probably select your toplevel view in each view controller and then tell Xcode to remove all the constraints and reset them to the suggested ones, and go from there.您可能应该在每个视图控制器中选择您的顶级视图,然后告诉 Xcode 删除所有约束并将它们重置为建议的约束,然后从那里开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从通用应用程序和转换iOS中的故事板的最佳方法是什么 - What is the best way from universal app and converting storyboard in ios 如何在Ios中从一个项目情节提要导航到另一个项目情节提要 - How to navigate from one project storyboard to another project storyboard in Ios 为一个控制器[Storyboard]创建人像和风景视图的最佳方法是什么? - What is the best way to create a portrait and a landscape view for one controller [Storyboard]? 从应用程序访问iOS文件系统的最佳方法是什么? - What is the best way to access iOS filesystem from an app? 将视图控制器从一个故事板移动或复制到另一个 - Move or copy view controller from one storyboard to another 我可以将故事板从一个项目复制到另一个项目吗? - Can I copy a storyboard from one project to another project? 将Twitter集成到iOS应用程序的最佳方法是什么? - What is the best way to integrate Twitter into an iOS app? 将数据从一个视图传递到另一个视图(Storyboard,iOS) - Passing Data from one View to another (Storyboard, iOS) 如何复制包含故事板的iOS 5.1应用程序 - How to copy an iOS 5.1 app including the storyboard 如何从一个故事板切换到另一个故事板 - How to switch from one storyboard to another storyboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM