最终编辑:好的,完全破解,但目前我喜欢“meh”它的工作原理。我为解决这个问题所做的只是添加android:lines="10"到 TextView,它显示了 2.2 和 ICS/JB 中的所有内容。完全破解,因为它根本不是抽象的,而是任何东西:P ..感谢所有帮助过的人!
我在使用 Gingerbread (API 10) 的自定义对话框中显示文本时遇到问题。显示的唯一文本是此处所示的第一行。在 Froyo、ICS 和 JB 中,它显示每一行文本。我相信这是一个 XML 的东西,但我不确定。我哪里错了?
编辑:我尝试过的:
- 将相对布局更改为线性布局
- 在 ScrollView 中添加
- 将我的字符串放在一行上
- 使用 requestLayout() 和 forceLayout()
- 将对话框功能放在一个单独的类中
- 取出按钮中的边距
- 使用 \n 而不是 HTML
-警报对话框
我的 TextView 上的 -inputType 和 singleLine XML 属性
-我想还有一两个我忘记了..
这是 XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_root"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/dia_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17dp"
android:padding="5dp"/>
<View
android:id="@+id/bar"
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#CCCCD0"
android:layout_below="@+id/dia_text"/>
<Button …Run Code Online (Sandbox Code Playgroud)