简体   繁体   English

将块复制到另一个屏幕MIT App Inventor

[英]Copy blocks to another screen MIT App Inventor

I published my app that has many screens, but now I want to go back and add a new feature to those screens. 我发布了我的应用程序有很多屏幕,但现在我想回去为这些屏幕添加一个新功能。 Is there any way that I can just create the new blocks once as a template and paste it to the new screens? 我有什么办法可以将新块作为模板创建并粘贴到新屏幕上吗?

copy-paste of code blocks is not a good idea: instead of creating redundant code, you should think about a redesign of your app, see the following link for more details. 代码块的复制粘贴并不是一个好主意:您应该考虑重新设计应用程序,而不是创建冗余代码,有关详细信息,请参阅以下链接。

Building apps with many screens 构建具有多个屏幕的应用

If it seems that your app requires a large number of screens, you might think about redesigning it to not use so many. 如果您的应用程序似乎需要大量屏幕,您可能会考虑重新设计它以免使用这么多屏幕。 For example, suppose your app has to show several different screen images all with the same functionality but each image having a different background. 例如,假设您的应用必须显示几个具有相同功能但每个图像具有不同背景的不同屏幕图像。 One way to code this would be to use a different App Inventor screen for each image, each screen with its own background image. 对此进行编码的一种方法是为每个图像使用不同的App Inventor屏幕,每个屏幕都有自己的背景图像。 With that method, you'd need as many screens as there are images. 使用该方法,您需要与图像一样多的屏幕。 But another way to code this is to have only a single screen and change the screen background. 但另一种编码方式是只有一个屏幕并更改屏幕背景。 Similar ideas apply to other kinds of elements: If each screen image has a label with its own text message, then rather than having multiple screens, each with its own label, you could have a single screen and a single label, and just change label's text. 类似的想法适用于其他类型的元素:如果每个屏幕图像都有一个带有自己文本消息的标签,那么您可以拥有一个屏幕和一个标签,而不是拥有多个屏幕,每个屏幕都有自己的标签,只需更改标签即可文本。

In App Inventor , you only can copy a complete screen, see the following method App Inventor中 ,您只能复制完整的屏幕,请参阅以下方法

How to copy screens by Scott and a video by Hossein 如何通过Scott和Hossein的视频 复制屏幕

EDIT : now there is the new backpack cut-and-paste system 编辑 :现在有新的背包剪切和粘贴系统

The Backpack allows you to carry around blocks throughout your project repositories, allowing blocks to be transferred between projects and between screens. Backpack允许您在整个项目存储库中随身携带块,允许在项目之间和屏幕之间传输块。 The contents of the Backpack persist throughout an App Inventor session. 在App Inventor会话期间,Backpack的内容将持续存在。 (NOTE:When you quit your App Inventor session or refresh the App Inventor page in the browser, the Backpack will be emptied -- ie, re-initialized.) (注意:当您退出App Inventor会话或在浏览器中刷新App Inventor页面时,背包将被清空 - 即重新初始化。)

It is not possible to copy objects (blocks, labels, pictures, lists, etc.) from one screen to another. 无法将对象(块,标签,图片,列表等)从一个屏幕复制到另一个屏幕。 See Issue 2076 : 问题2076

It would be nice to be able to copy objects (labels, pictures, lists, ect.) from one screen to another, theoretically the way it would function is: on the right side on the components list, you could right click on the component you would like to copy and press either copy/paste or you could right click and press send to screen Y. Any blocks related to these components on screen X would be sent with the copied components to screen Y. This would be very useful/helpful instead of trying to recreate multiple pages with the same layout and block structure multiple times. 能够将对象(标签,图片,列表等)从一个屏幕复制到另一个屏幕会很好,理论上它的功能是:在组件列表的右侧,您可以右键单击组件您想要复制并按下复制/粘贴,或者您可以右键单击并按发送到屏幕Y.屏幕X上与这些组件相关的任何块都将与复制的组件一起发送到屏幕Y.这将非常有用/有帮助而不是尝试多次重建具有相同布局和块结构的多个页面。

将块拖到你的包里,如果你想使用,只需检查你的包

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM