【问题标题】:Android TextView not visible on Jelly BeanAndroid TextView 在 Jelly Bean 上不可见
【发布时间】:2014-06-25 01:43:09
【问题描述】:

我在 Jelly Bean 4.1 和 4.2 设备上显示文本时遇到问题。这是您第一次打开我的应用程序时的屏幕截图。什么都没碰过。

如您所见,4.1 和 4.2 不显示任何文本。我没有使用自定义字体或类似的东西。这是我的 TextView 的 xml:

<TextView
    android:text="test"
    android:layout_toLeftOf="@+id/card_days_view"
    android:layout_marginTop="3dp"
    android:layout_marginLeft="10dp"
    android:layout_marginRight="10dp"
    android:id="@+id/textPrim"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fontFamily="sans-serif-condensed"
    android:textColor="#393939"
    android:maxLines="1"
    android:singleLine="true"
    android:ellipsize="end"
    android:layout_marginBottom="-6dp"
    android:textSize="36sp" />

可能是什么问题?其他人遇到过这个问题吗?我试着用谷歌搜索了一下,但什么也没出现。任何帮助表示赞赏!

【问题讨论】:

  • 我认为是android:fontFamily="sans-serif-condensed" 的问题,删除它试试
  • @for3st 我尝试删除它,但没有区别。 sans-serif-condensed 是在 4.1 中添加的,因此很可能与问题无关。
  • 那么它在哪个sdk上工作?
  • @f0r3st 如屏幕截图所示,它适用于 4.3,也适用于 4.4
  • @SweSnow 为行添加整个 xml 布局。

标签: android visibility textview android-4.2-jelly-bean


【解决方案1】:

您是否尝试过在 Eclipse 中使用“层次结构视图”- 透视图进行调试?通常这很有帮助,因为您可以读取在渲染期间确定的布局属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-11
    • 2014-01-27
    相关资源
    最近更新 更多