本文介绍了Android studio中的拖放功能不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android编程的新手android工作室中的拖放功能不起作用。我无法拖动任何东西到我的手机。现在我的片段是谷歌地图视图,我想添加一个搜索栏到视图。它只是不拖动。当我尝试添加它在文本中它表示元素项不允许在这里?

I'm new to android programming The drag/ and drop feature in android studio is not working. I can't drag anything to my phone. Right now my fragment is google map view and i want to add a search bar to the view. It just doesn't drag. When I try to add it in text it says element item not allowed here?

这是我的activity_maps.xml文件

This is my activity_maps.xml file

 <fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
android:layout_height="match_parent" android:id="@+id/map" tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment">
<item android:id="@+id/search"
    android:title="@string/search_title"
    android:icon="@drawable/ic_search"
    android:showAsAction="collapseActionView|ifRoom"
    android:actionViewClass="android.widget.SearchView" />
</fragment>


推荐答案

新版本的android studio使用2个xml文件每个布局。一个(例如content_main.xml)嵌入另一个(Activity_main.xml)中。
你应该打开内容_ *。xml并在其中进行设计。
希望它有帮助。

the new version of android studio uses 2 xml files for each layout. One (e.g. content_main.xml) embedded in the other one (Activity_main.xml).you should open the content_*.xml and do the design in it.hope it helps.

这篇关于Android studio中的拖放功能不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 04:51
查看更多