【问题标题】:Nexus 7 Spinners too largeNexus 7 微调器太大
【发布时间】:2012-08-27 03:07:03
【问题描述】:

我有一个使用 Nexus 7 的用户反馈给我说我的应用程序屏幕显示正常,除了我的 Spinners,它看起来比他们应该做的大得多。

普通画面 http://imgur.com/eG7b3

Nexus 7 上的大型微调器 http://imgur.com/X4Kqo

我有一个Spinner TextView 布局:

<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/textview"
    android:layout_height="36dip"
    android:layout_width="match_parent"
    android:textSize="24.5sp"
    android:textColor="#768766"
/>

这是由RelativeLayout制作的:

<Spinner
    android:id="@+id/spinner_weekday1"
    android:layout_below="@id/col1day"
    android:layout_height="wrap_content"
    android:prompt="@string/enterday"
    android:layout_width="200dip"
    android:entries="@array/weekdaylist"
    android:layout_marginRight="60dp"
    android:layout_marginBottom="20dip"
    android:textSize="24.5sp"
    android:textColor="#768766"
/>

我的应用程序可以在一系列其他设备上运行,看起来还不错。任何想法为什么 Nexus 7 可能会以这种方式显示 Spinners

【问题讨论】:

    标签: android spinner


    【解决方案1】:

    好的,我已经找到了解决办法。

    我在上面发布的 Spinner 布局实际上是来自 res/layout-xlarge 的 Spinner,而 Nexus 是一个大型设备。 res/layout-large 包含以下 xml:

    android:textSize="200sp"
    

    应该是什么时候:

    android:textSize="20sp"
    

    这当然是微调器文本显得如此之大的原因。

    我想这凸显了在不为每个布局尺寸配备物理测试设备的情况下尝试管理多种布局尺寸的难度。

    【讨论】:

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