带有MapView和其他元素的Android布局:意外的结果(我知道...可能是我...



那么,我有了这个布局文件:

<merge>
    <com.google.android.maps.MapView 
          android:id="@+id/mapView"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent".../>
    <LinearLayout topNav
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="top".../>
    <LinearLayout bottomNav 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom".../>
</merge>

这个想法是有一个顶部和底部的按钮栏做的事情。

当我这样做时,条形图显示正确,中间的地图扩展了整个东西,除了条形图。然后添加

mapView.setBuiltInZoomControls(true); 

和一个有趣的事情发生了:缩放控件出现在较低的栏,没有触摸焦点(即当我触摸他们,我实际上点击按钮下面的栏本身)。

我试着玩android:weight无效(即设置权重=1的地图,设置权重=0.5的酒吧)

建议吗?

谢谢!

,

llappall

我认为问题可能是lauout_height设置为"fill_parent"而不是地图视图的"wrap_content"。

你可以试试这个吗:

<com.google.android.maps.MapView 
          android:id="@+id/mapView"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content".../>

相关内容

最新更新