简体   繁体   中英

Why can't I drag anything onto 'activity_main.xml' in Android Studio?

I am following this tutorial on how to use Android Studio to create android apps. At time 17:13 in the video the user drags an object named "ImageButton" onto the picture (emulation) of a phone. I cannot do that, I see a sign like 在此输入图像描述 instead.

How can I fix that in order to follow the tutorial?

As you can see if you look at the xml text, the activity_main.xml now includes content_main.xml. So to edit the content of activity_main.xml you need to open content_main.xml and edit that with drag-and-drop or editing the raw file. This is just a new thing in the latest version of android studio. Everything on that main page used to be in activity_main instead of being split up into two xml files as it is now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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