Addres book like Spinner/ListView items

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Addres book like Spinner/ListView items

Postby keylimepai » Wed May 27, 2009 7:21 pm

Hello!

So, what I'm trying to do is to recreate a ListView / Spinner with a title and some information about it, in a way that's similar to the formatting of the address book.

That is, it would be like this:

[hr]Apple
Use: Keeps the doctor away
[hr]

I'm sure the secret lies in the resource definition, but I'm really quite new to laying everything out in the Android XML, and thus am not even sure what to -call- this to try and search for an example.

Thank you very much for any help!

[hr]

EDIT: I should answer my own question =)

It can be done two ways! First, if the data is static, basic formatting can be done with:

Code: Select all
...
   <string-array name="...">
      <item>Applen<SMALL><b>Use:</b>Keeps the doctor away</SMALL></item>
      ...
   </string-array>
...


Or more complicated formatting can be done with the "Spannable" class - http://developer.android.com/reference/ ... nable.html

Found on: http://developer.android.com/guide/appe ... ectingtext
keylimepai
Junior Developer
Junior Developer
 
Posts: 14
Joined: Wed May 27, 2009 7:14 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 4 guests