最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android地圖控件之多地圖展示

 更新時間:2016年06月14日 11:07:19   作者:rainmj  
這篇文章主要為大家詳細(xì)介紹了Android地圖控件之多地圖展示,具有一定的參考價值,感興趣的小伙伴們可以參考一下

一、簡介 
地圖控件自v2.3.5版本起,支持多實(shí)例,即開發(fā)者可以在一個頁面中建立多個地圖對象,并且針對這些對象分別操作且不會產(chǎn)生相互干擾。
 文件名:Demo04MultiMapView.cs
 簡介:介紹多MapView的使用
 詳述:在一個界面內(nèi),同時建立四個TextureMapView控件;
 二、示例
 1、運(yùn)行截圖
在x86模擬器中的運(yùn)行效果如下:  

在上一節(jié)例子的基礎(chǔ)上,只需要再增加下面的步驟即可。

2、添加demo05_multimap.axml文件 
在layout文件夾下添加該文件,將其改為下面的代碼:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:map="http://schemas.android.com/apk/res-auto"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:orientation="vertical" >

 <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginBottom="5dp"
  android:layout_weight="1"
  android:orientation="horizontal" >

  <fragment
   android:id="@+id/map1"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_marginRight="5dp"
   android:layout_weight="1"
   class="com.baidu.mapapi.map.TextureMapFragment" />

  <fragment
   android:id="@+id/map2"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_weight="1"
   class="com.baidu.mapapi.map.TextureMapFragment" />
 </LinearLayout>

 <LinearLayout
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_weight="1"
  android:orientation="horizontal" >

  <fragment
   android:id="@+id/map3"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_marginRight="5dp"
   android:layout_weight="1"
   class="com.baidu.mapapi.map.TextureMapFragment" />

  <fragment
   android:id="@+id/map4"
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:layout_weight="1"
   class="com.baidu.mapapi.map.TextureMapFragment" />
 </LinearLayout>

</LinearLayout> 

3、添加Demo05MultiMapView.cs文件
在SdkDemos文件夾下添加該文件,然后將其內(nèi)容改為下面的代碼:

using Android.App;
using Android.Content.PM;
using Android.OS;
using Com.Baidu.Mapapi.Map;
using Com.Baidu.Mapapi.Model;

namespace BdMapV371Demos.SrcSdkDemos
{
 /// <summary>
 /// 在一個Activity中展示多個地圖
 /// </summary>
 [Activity(Label = "@string/demo_name_multimap",
  ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.KeyboardHidden,
  ScreenOrientation = ScreenOrientation.Sensor)]
 public class Demo05MutiMapView : Activity
 {
  private readonly LatLng Geo_BeiJing = new LatLng(39.945, 116.404);
  private readonly LatLng Geo_ShangHai = new LatLng(31.227, 121.481);
  private readonly LatLng Geo_GuangZhou = new LatLng(23.155, 113.264);
  private readonly LatLng Geo_ShenZhen = new LatLng(22.560, 114.064);

  protected override void OnCreate(Bundle savedInstanceState)
  {
   base.OnCreate(savedInstanceState);
   SetContentView(Resource.Layout.demo05_multimap);
   InitMap();
  }

  /// <summary>
  /// 初始化Map
  /// </summary>
  private void InitMap()
  {
   MapStatusUpdate u1 = MapStatusUpdateFactory.NewLatLng(Geo_BeiJing);
   TextureMapFragment map1 = FragmentManager.FindFragmentById<TextureMapFragment>(Resource.Id.map1);
   map1.BaiduMap.SetMapStatus(u1);

   MapStatusUpdate u2 = MapStatusUpdateFactory.NewLatLng(Geo_ShangHai);
   TextureMapFragment map2 = FragmentManager.FindFragmentById<TextureMapFragment>(Resource.Id.map2);
   map2.BaiduMap.SetMapStatus(u2);

   MapStatusUpdate u3 = MapStatusUpdateFactory.NewLatLng(Geo_GuangZhou);
   TextureMapFragment map3 = FragmentManager.FindFragmentById<TextureMapFragment>(Resource.Id.map3);
   map3.BaiduMap.SetMapStatus(u3);

   MapStatusUpdate u4 = MapStatusUpdateFactory.NewLatLng(Geo_ShenZhen);
   TextureMapFragment map4 = FragmentManager.FindFragmentById<TextureMapFragment>(Resource.Id.map4);
   map4.BaiduMap.SetMapStatus(u4);
  }
 }
} 

4、修改MainActivity.cs文件
在MainActivity.cs文件的demos字段定義中添加下面的代碼。   

  //示例5--多地圖展示
   new DemoInfo<Activity>(Resource.String.demo_title_multimap,
    Resource.String.demo_desc_multimap,
    new Demo05MutiMapView()), 

運(yùn)行觀察結(jié)果。

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Android仿QQ登陸窗口實(shí)現(xiàn)原理

    Android仿QQ登陸窗口實(shí)現(xiàn)原理

    今天根據(jù)騰訊qq,我們做一個練習(xí),來學(xué)習(xí)如何制作一個漂亮的布局仿QQ登陸,還是一個啟動畫面,之后進(jìn)入登錄頁面,導(dǎo)航頁面就不介紹了,大家可以參考微信的導(dǎo)航頁面
    2013-01-01
  • Android簡單實(shí)現(xiàn)圓盤抽獎界面

    Android簡單實(shí)現(xiàn)圓盤抽獎界面

    這篇文章主要介紹了Android簡單實(shí)現(xiàn)圓盤抽獎界面的相關(guān)資料,需要的朋友可以參考下
    2016-01-01
  • Android異步方法以同步方式實(shí)現(xiàn)

    Android異步方法以同步方式實(shí)現(xiàn)

    這篇文章主要為大家詳細(xì)介紹了Android異步方法以同步方式進(jìn)行的實(shí)現(xiàn)方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • Android okhttp的啟動流程及源碼解析

    Android okhttp的啟動流程及源碼解析

    這篇文章主要介紹了Android okhttp的啟動流程及源碼解析,幫助大家更好的理解和學(xué)習(xí)使用Android開發(fā),感興趣的朋友可以了解下
    2021-03-03
  • Android Activity回收與操作超時處理

    Android Activity回收與操作超時處理

    這篇文章主要介紹了Android Activity回收與操作超時的相關(guān)處理操作,感興趣的小伙伴們可以參考一下
    2016-04-04
  • Android動畫系列之屬性動畫的基本使用教程

    Android動畫系列之屬性動畫的基本使用教程

    這篇文章主要給大家介紹了關(guān)于Android動畫系列教程之屬性動畫的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-12-12
  • Android 馬賽克(Mosaics)效果

    Android 馬賽克(Mosaics)效果

    這篇文章主要為大家介紹了Android 馬賽克(Mosaics)效果,馬賽克(Mosaics)效果應(yīng)用非常廣泛,想要學(xué)習(xí)的不要錯過本文,可以借鑒參考一下
    2016-01-01
  • Android小程序?qū)崿F(xiàn)簡易QQ界面

    Android小程序?qū)崿F(xiàn)簡易QQ界面

    這篇文章主要為大家詳細(xì)介紹了Android小程序?qū)崿F(xiàn)簡易QQ界面,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2020-05-05
  • android實(shí)現(xiàn)簡單的乘法計算代碼

    android實(shí)現(xiàn)簡單的乘法計算代碼

    本文完成輸入2個數(shù)相乘,并顯示其結(jié)果。共涉及到4個控件的使用學(xué)習(xí),輸入數(shù)字采用EditText,顯示結(jié)果用TextView,運(yùn)算按鈕button以及菜單中的退出鍵
    2013-11-11
  • Android手勢滑動實(shí)現(xiàn)ImageView縮放圖片大小

    Android手勢滑動實(shí)現(xiàn)ImageView縮放圖片大小

    這篇文章主要為大家詳細(xì)介紹了Android手勢滑動實(shí)現(xiàn)ImageView縮放圖片大小的相關(guān)資料,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-02-02

最新評論

江阴市| 高密市| 邢台县| 丹东市| 广平县| 盐源县| 香港 | 湾仔区| 温宿县| 灵宝市| 宜城市| 安吉县| 新兴县| 江达县| 盐源县| 叙永县| 察隅县| 昭苏县| 施甸县| 邵阳县| 耒阳市| 明溪县| 佛坪县| 莱阳市| 沧源| 铜梁县| 治县。| 怀来县| 中方县| 东乡| 汤阴县| 天气| 长宁区| 宝兴县| 本溪| 额尔古纳市| 凉城县| 利辛县| 成武县| 呈贡县| 图木舒克市|