无法在 Android Studio 中向 activity_main.xml 添加任何项目 [英] Can't add any items to activity_main.xml in Android Studio

查看:26
本文介绍了无法在 Android Studio 中向 activity_main.xml 添加任何项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Android Studio 中,我无法将 Palette 中的任何项目添加到设计视图中的 activity_main.xml.它只是不会让我拖放它们.知道为什么会这样吗?

In Android Studio, I can't add any items from Palette to activity_main.xml in Design view. It just won't let me drag and drop them. Any idea why this happens?

这是打印屏幕:

推荐答案

根据 android studio 为 android 开发遵循的新设计方法,您不能在 activity_main.xml 中添加任何元素.相反,您应该将它们添加到 content_main.xml.

According to new design method followed in android studio for android development you cannot add any elements to the activity_main.xml. Rather you should add them to content_main.xml.

您可以从这个答案中了解更多信息.

You can learn more about it from this answer.

这篇关于无法在 Android Studio 中向 activity_main.xml 添加任何项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆