On Tue, Mar 3, 2009 at 6:26 AM, droozen <[email protected]> wrote: > > So, we're supposed to be using our strings.xml to construct most or > all of our strings, right? I had a situation where I wanted to display > to the user "Some string blah blah " + some value. So I put two views > in a horizontal LinearLayout, with my "Some string blah blah " (with > that space on the end, no quotes) in the strings.xml. I reference the > string in my first view, then set the value in the second view. > However, if I set it up like this, the space at the end of my string > gets trimmed off, which doesn't look pretty. My workaround was not to > use the strings.xml and place the "Some string blah blah " (no quotes) > directly in the android:text parameter of the TextView. > > Any idea if there is a better way to do this? Or should I submit a bug > to Android about this?
Instead of breaking up the string and using two TextViews to display what is supposed to be a single string, you should use a single TextView and a string in your resource like "Some string blah blah %s", and then use the version of Context.getString() that takes format-arguments. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

