代码之家  ›  专栏  ›  技术社区  ›  Andrew

椭圆尺寸问题

  •  0
  • Andrew  · 技术社区  · 15 年前

                    <TextView 
                        android:id="@+id/profile_email"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:padding="6dip"
                        android:textColor="#000000"
                        android:maxLines="1"
                        android:ellipsize="end" />
    

    我的问题是许多电子邮件地址在中间被截断,而不是在结尾有一个椭圆。下面是一个例子:

    如果我的电子邮件地址是

    short.name@mydomain.com
    

    一切正常。但是,如果我的电子邮件地址是

    really.longfreakennameforanemailaddressandscreenisntwideenough@mydomain.com
    

    唯一能展示的是

    really.
    

    1 回复  |  直到 15 年前
        1
  •  0
  •   fedj    15 年前

    作为解决方法,您可以使用:

    android:scrollHorizontally="true"