【发布时间】:2011-10-04 09:59:21
【问题描述】:
我的应用程序中有一个地图视图。 我已经在相对布局中设置了 294x322 图像,并且在 relativelayout 下我添加了带有 wrap_conten 作为高度的 mapview,并且 wight 认为地图视图还将包含 relativelayout 的高度和重量 294x322 的大小。但是在运行时我的 mapview 会填充 parent.one 解决方案我发现是给背景图像的相对布局提供静态高度宽度,但问题是我有两个同名的图像,我把它们放在 hdpi 和 mdpi 文件夹中。所以它不适用于多屏幕分辨率。
我在这里添加我的 xml 文件
<!-- MapView -->
<RelativeLayout
android:id="@+id/layout_mapRestaurant"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rlBtnView"
android:layout_centerHorizontal="true"
android:paddingLeft="15dip"
android:paddingTop="15dip"
android:paddingRight="15dip"
android:paddingBottom="40dip"
android:layout_marginTop="-25dip"
android:background="@drawable/mapbg"
>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview_SearchResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="true"
android:background="@drawable/bg_border"
/>
</RelativeLayout>
以下是我设计的图形布局
以下是我在运行时显示的实际布局。
谁能告诉我如何摆脱这个问题?????
【问题讨论】:
标签: android android-layout android-widget android-manifest