【问题标题】:System Bar hides menu items系统栏隐藏菜单项
【发布时间】:2012-03-06 18:00:37
【问题描述】:

我们为 2.1 版开发了一个 android 应用,但客户要求它也应该在 3.0 上运行。一切似乎都很好,但我的系统栏有问题。它将菜单按钮隐藏为http://i.imgur.com/NEkkg.png

我该怎么办?

提前致谢。 编辑:这是布局文件:

    <?xml version="1.0" encoding="utf-8"?>
    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
         android:id="@+id/imageandsoundroot"
         android:layout_width="fill_parent"
         android:layout_height="fill_parent" >

    <View
        android:id="@+id/imageandsoundcontextmenutrigger"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:visibility="gone" />

    <ImageView 
        android:id="@+id/imageandsoundimage"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scaleType="fitCenter" />

</FrameLayout>

【问题讨论】:

    标签: android android-layout android-3.0-honeycomb


    【解决方案1】:

    通常情况下,这不会发生。我能想到的唯一方法是做开发人员反复被告知不要做的事情,即尝试根据物理屏幕尺寸调整事物的大小(例如,通过DisplayMetrics)。

    修复您的代码以使用传统方法进行大小调整(例如,android:layout_height="match_parent"),我怀疑这个问题会消失。

    【讨论】:

    • 我正在使用 Sdk 版本 7 和在 Sdk 版本 8 中引入的 match_parent。我没有使用 DisplayMetrics 来调整屏幕大小。我将 xml 文件发布到问题中
    【解决方案2】:

    问题是我为菜单项使用了太大的图像。我使用了较小的图像,问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-05
      • 2012-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-18
      • 1970-01-01
      • 2018-02-22
      相关资源
      最近更新 更多