• long texts

    By Fero Kossuth 1 decade ago

    I know this is more about dojo.mobile, but...

     

    List view renders awfully for lines wider than screen.  Text and background grid does not match. Native iPhone applications solve this by truncating text to single line (dynamicaly, so if you rotate the phone, truncated length is different, and if it does not fit even in horizontal orientation, user just opens detail to read full data).

    How can I achieve this behavior (truncating of long lines according to actual screen width) inside data view?

    Thanks in advance.

    • Re: long texts

      By Lorcan McDonald 1 decade ago

      Could you take a screen shot to show exactly what you mean?

      • here

        By Fero Kossuth 1 decade ago

        stolen from somewhere via google images, but anyway: anything longer than single line is trimmed and followed by "..."

        http://sarahdines.files.wordpress.com/2010/08/picture-36.png

        • text-overflow: ellipses

          By Lorcan McDonald 1 decade ago

          Ah ok, luckily the mobile browsers have a higher average level of support for CSS3. There's actually a rule for that. Try:

          text-overflow: ellipses;

           

          white-space: nowrap;

          (http://www.quirksmode.org/css/textoverflow.html is a good treatment of the subject)

          • thanks!

            By Fero Kossuth 1 decade ago

            didn't know :-(

            • CSS3

              By Lorcan McDonald 1 decade ago

              No problem. It can take a while to adjust to the mobile browsers having much better support for HTML5 features :-)