Gallery with Text: Font styling

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

Gallery with Text: Font styling

Postby surtax » Tue Jan 19, 2010 12:38 am

I currently have a Gallery Widget very similar to Gallery2.java in the
API examples. It is a gallery widget populated by a simple adaptor of
text.

What I am trying to do is make the selected (the item at the center of
the gallery widget) text and background a certain color and the other
visible items a different color. It should be a simple task, but I am
unable to find a tutorial or the place in which to insert these
options.

Code which will modify the existing Gallery2.java to display the
center item as Red for example whereas the other items remain the gray
color would be very helpful.

Many thanks in advance.
surtax
Freshman
Freshman
 
Posts: 8
Joined: Fri Jun 12, 2009 7:03 am

Top

Postby nithin.warier » Tue Jan 19, 2010 1:17 pm

You can give the background color, just by giving something like this, android:background="#ff0000"(red) for gallery widget in xml. For changing the color of selected, use OnItemClickListener(), then for the selected view, give the color that you want.
smartandroidians.blogspot.com
nithin.warier
Experienced Developer
Experienced Developer
 
Posts: 87
Joined: Thu Feb 28, 2008 12:05 pm
Location: Malappuram Kerala India

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: Majestic-12 [Bot] and 8 guests