Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 4    Views: 119

sarahk
Code is Art
Profile
Posts: 159
Reg: Jul 16, 2014
Auckland
10,290
03/04/16 05:45 AM (8 years ago)

Menu with Image

Hi Susan Is there a best practice way to truncate menu names for Android? In iOS long labels just run off the screen which is great. In android they wrap, which you'd think would be good but isn't. I'll just chop them off at a particular length but that risks being too short on some devices. Example: https://www.dropbox.com/s/5dadg1bxk1h55p0/screenshot-android.png?dl=0
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/04/16 07:24 AM (8 years ago)
Hi Sarah, I think it's going to depend entirely on the device being used, the screen size of that device, the resolution of the screen, whether the user has weird fonts or not, the font size you've selected in your control panel, and about a billion other Android oddities you'll run into! I haven't seen any recommendations with respect to menu text length for Android. iOS handles it much better for sure. Mark
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/04/16 02:57 PM (8 years ago)
I'm still looking for an 'elegant' solution... but for the moment, Android has the 'ellipsize' property in the text view: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/text_mytext" android:ellipsize="end" android:singleLine="true" /> It shouldn't take but a second to see if it'll work for you; test it in a sample xml layout file. Cheers! -- Smug
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/04/16 03:11 PM (8 years ago)
Smug is so much smarter than me! Total code ninja!
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
03/06/16 07:48 AM (8 years ago)
Awesome Smug! LA
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.