【发布时间】:2019-11-02 11:13:50
【问题描述】:
所以我有一个看起来像这样的应用程序:
但是在创建 gui 的过程中,我总是必须使用文本模式创建按钮等,因为谷歌地图片段挡住了我的整个设计屏幕:
这是我的文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:orientation="horizontal">
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="4"
android:hint="Search Location" />
<Button
android:id="@+id/search_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:onClick="onMapSearch"
android:text="Search" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Type: " />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onNormalMap"
android:text="Normal" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onSatelliteMap"
android:text="Satellite" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onTerrainMap"
android:text="Terrain" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="onHybridMap"
android:text="Hybrid" />
</LinearLayout>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.viralandroid.googlemapsandroidapi.MapsActivity" />
</LinearLayout>
我该如何解决这个问题?即使我只有谷歌地图片段而没有任何其他组件,它仍然会阻塞我的整个编辑屏幕......
【问题讨论】:
-
试试 layout_weghit
-
试试 layout_weghit
-
@MohammadSommakia 我需要把它放在哪里?
标签: android google-maps android-fragments maps designmode