【问题标题】:Blank screen on SlidingMenu when using with Fragment (GMap)与 Fragment (GMap) 一起使用时 SlidingMenu 上的空白屏幕
【发布时间】:2013-06-06 16:51:31
【问题描述】:

所以我在我的应用程序中使用带有 FragmentActivity 的 SlidingMenu 库。

布局中有一个谷歌地图,左侧有一个包含一些内容的菜单。 当我拉菜单查看它时,那里有一个黑色的大矩形,覆盖了我的滑动菜单内容。我点击一次后,它就消失了。

有人对此有什么想说的吗?

【问题讨论】:

    标签: android google-maps android-fragmentactivity android-maps-v2 android-sliding


    【解决方案1】:

    我在 android 2.3.7 上遇到了同样的问题,但在 3.x 或更高版本中没有。旋转视图后,菜单呈现良好。

    我从Android MapView With Sliding Menu Obscures Menu 找到了使用自定义透明支持映射片段的解决方案

    【讨论】:

      【解决方案2】:

      片段黑屏问题

      <FrameLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent" >
      
          <android.support.v4.view.ViewPager
              android:id="@+id/fragment_container"
              android:layout_width="match_parent"
              android:layout_height="match_parent" >
           </android.support.v4.view.ViewPager>
      
           <!-- hack to fix ugly black artefact with maps v2 -->
           <FrameLayout 
              android:layout_width="match_parent"
              android:layout_height="match_parent" 
              android:background="@android:color/transparent" />
      
      </FrameLayout>
      

      【讨论】:

        【解决方案3】:

        这是一个已知问题。

        您可能想看看这些问题:

        http://code.google.com/p/gmaps-api-issues/issues/detail?id=4639

        http://code.google.com/p/gmaps-api-issues/issues/detail?id=4659

        也许你可以在 cmets 那里找到解决方法。

        【讨论】:

        • 不适合我,我在滑动菜单中找到了黑色区域。
        【解决方案4】:

        我知道这个问题太老了,但由于我偶然来到这里,发现没有公认的答案,我会回答这个问题。希望有一天它对某人有所帮助。

        我的解决方案是在您的“Shopradar”布局上方添加一个带有透明背景的浅色布局(大约 1dp)。这对我有用,希望它也对你有用;)

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2014-02-23
          • 1970-01-01
          • 1970-01-01
          • 2018-06-17
          • 1970-01-01
          相关资源
          最近更新 更多