0

I was new on Android,before I am an iphone developer.These days I met a problem that I could't figure out.

In my application, I've ellipsized my TextView so that if the text is too large, it'll show ... in the middle using android:ellipsize="middle".

It works well on Android 2.2 and 2.3.But on android 4.0.4,it does not work well. I use Samsang GALAXY SIII.It only shows "." in the middle.But if I run the project on Emulater 4.0.4,it will work well.I am confused.

People all tell me it will works well when I set singleLine true.But it still does not work.

My *.xml like this,textView:

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:singleLine="true"
    android:ellipsize="middle"
    android:text="@string/hello" />

string/hello=Hello World, TestTextActivity!justtestjusttestjusttestjusttestjusttestjusttestjusttestjusttestjusttestjusttest

4

1 に答える 1

0
Use This:-


 <TextView
        android:id="@+id/emailidedittextid"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:ellipsize="marquee"
        android:focusable="true"
        android:focusableInTouchMode="true"
        android:freezesText="true"
        android:marqueeRepeatLimit="marquee_forever"
        android:paddingLeft="6dp"
        android:paddingRight="15dip"
        android:scrollHorizontally="true"
        android:singleLine="true"
        android:text="START | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | END" >
    </TextView>
于 2012-11-03T12:49:05.670 に答える