龙文云对ICS的下一行,但不能在GB及以下 [英] Long text goes to next line on ICS, but not on GB and below

查看:146
本文介绍了龙文云对ICS的下一行,但不能在GB及以下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次注意到这是与AlertDialogs将在第一行的全部信息,甚至当我指定了一个新行(\ N)。在ICS它显示了正确的方法,但对我的生活,我不能让它工作在GB。

The first time I noticed this was with AlertDialogs putting the entire message on the first line, even when I specified a new line("\n"). On ICS it displays the correct way, but for the life of me, I couldn't get it to work on GB.

最近我又跑了进去。我没有看到它的工作罚款ICS而不是GB及以下的任何理由。

Recently I've run into it again. I don't see any reason for it working fine on ICS but not GB and below.

示例项目

下面有一个例子项目,一个TextView,alertdialog和两个标准textviews。

Heres an example project with a textview, alertdialog, and two standard textviews.

https://github.com/T3hh4xx0r/Text-Example

修改

继承人原来的问题我问。看来问题比我当初注意到,虽然。

Heres the original question I asked. Seems the problem is more than I originally noticed though.

<一个href="http://stackoverflow.com/questions/9542284/android-alertdialog-not-displaying-entire-setmessage-on-certain-devices">Android AlertDialog不显示在某些设备上的整个setMessage

/修改

下面是我的意思可视化的例子。

Here are visual examples of what I mean.

甚至专门设置TextView的多行,文本仍然是一条线,但低于多余的空行。

Even specifically setting multiple lines for the textView, the text is still one line, but with extra blank lines below.

推荐答案

下面是该alertdialog被用来创建视图的布局:

Here is the layout that the alertdialog is using to create your view:

<!--
    This layout file is used by the AlertDialog when displaying a list of items.
    This layout file is inflated and used as the TextView to display individual
    items.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="?android:attr/listPreferredItemHeight"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textColor="@android:color/primary_text_light_disable_only"
    android:gravity="center_vertical"
    android:paddingLeft="14dip"
    android:paddingRight="15dip"
    android:ellipsize="marquee"
/>

正如你可以看到ellipsize设置为选取框,所以我不相信这是有史以来的意图,让多线。

As you can see the ellipsize is set to marquee, so I don't believe it was ever written with the intention to allow multilines.

目前的时刻,椭圆点是从来没有表现出开放式的错误:<一href="http://$c$c.google.com/p/android/issues/detail?id=10554">http://$c$c.google.com/p/android/issues/detail?id=10554

There is a bug open at the moment that ellipse dots are never shown: http://code.google.com/p/android/issues/detail?id=10554

因此​​它的行为正常。

Therefore it is acting correctly.

如果你希望它去的多行,创建自己的布局文件,并传递到您的对话框,这样你有更多的控制呢。

If you want it to go onto multiple lines, create your own layout file and pass that to your dialog, that way you have more control anyway.

这篇关于龙文云对ICS的下一行,但不能在GB及以下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆