Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
嵌入android应用程序的谷歌地图_Android_Google Maps - Fatal编程技术网

嵌入android应用程序的谷歌地图

嵌入android应用程序的谷歌地图,android,google-maps,Android,Google Maps,嗨,我想在我的应用程序中使用谷歌地图,但我也想为它创建自己的页脚菜单。所以从上到下它应该看起来像页眉-谷歌地图-页脚。我尝试将relativeLayout和linearLayout添加到mapview的embed中,但没有实现 你能给我举个例子或告诉我一些方法吗 读取布局权重- 如果有三个视图,并将权重设置为0、1和0,则中间的视图将调整大小,其他两个视图将保持固定大小,因此这是向调整大小的视图添加页眉和页脚的好方法。尝试此模板代码,并注意如何设置布局权重: <?xml version="

嗨,我想在我的应用程序中使用谷歌地图,但我也想为它创建自己的页脚菜单。所以从上到下它应该看起来像页眉-谷歌地图-页脚。我尝试将relativeLayout和linearLayout添加到mapview的embed中,但没有实现


你能给我举个例子或告诉我一些方法吗

读取布局权重-

如果有三个视图,并将权重设置为0、1和0,则中间的视图将调整大小,其他两个视图将保持固定大小,因此这是向调整大小的视图添加页眉和页脚的好方法。尝试此模板代码,并注意如何设置布局权重:

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

        <!-- Header -->
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
        />

        <!-- Map -->
        <MapView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            ....
        />

        <!-- Footer, or another embedded Layout -->
        <ImageView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="0"
        />
</LinearLayout>

首先感谢您的回复,效果非常好。而且我今天刚达到15名,所以从现在起我可以把答案打勾作为有用的:)