【问题标题】:android : SlidingDrawer, RelativeLayout and GoogleMapandroid:SlidingDrawer、RelativeLayout 和 GoogleMap
【发布时间】:2013-09-20 09:31:55
【问题描述】:

我有一个带有滑动抽屉的谷歌地图。小部件位于谷歌地图上方,但我想将我的谷歌地图放在滑动抽屉的内容上方(而不是滑动抽屉上方)。我不能在@+id/content 上放置像上面或下面这样的属性,因为LinearLayout 不是RelativeLayout 的子对象。

所以我的问题是:有可能吗?

我找到的唯一方法是在地图上放一个android:layout_marginBottom,但不是很干净

代码更明确:

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

<fragment
    android:id="@+id/map"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    class="com.google.android.gms.maps.SupportMapFragment" />

<RelativeLayout
    android:id="@+id/progress_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#40000000"
    android:visibility="gone" >

    <ProgressBar
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true" />
</RelativeLayout>

<ImageView
    android:id="@+id/refresh"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginLeft="10dp"
    android:layout_marginTop="10dp"
    android:background="@drawable/btn_refresh_map"
    android:padding="4dp"
    android:visibility="gone" />

<com.ui.custom.WrappingSlidingDrawer
    xmlns:my="http://schemas.android.com/apk/res/com.ecab"
    android:id="@+id/bottom"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:orientation="vertical"
    android:content="@+id/content"
    android:handle="@+id/handle"
    android:background="#00000000" >

    <LinearLayout
        android:id="@+id/handle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/light_gray"
        android:orientation="vertical" >
    [...]
    </LinearLayout>

    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/light_gray"
        android:orientation="vertical" >
    [...]
    </LinearLayout>
</com.ui.custom.WrappingSlidingDrawer>
</RelativeLayout>

【问题讨论】:

    标签: android slidingdrawer


    【解决方案1】:

    SlidingDrawer over GoogleMap

    不太清楚它是否有帮助

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多