Highlight and focus

Put your problem here if it does not fit any of the other categories.

Highlight and focus

Postby LW » Mon Jan 07, 2008 11:34 am

Hello, i just want to create a simple table with property and rows, like first name, last name, adress.
I think I made the hardest part, if i click on a random row ( a tableRow inside tableLayout ), the console displays all the data I choose, but there's no highlight on the row. How can i do this?

TextBox, button etc are already "highlightable" but not my rows even if i made them focusable.

thx
LW
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Dec 31, 2007 2:05 pm

Top

Re: Highlight and focus

Postby plusminus » Mon Jan 07, 2008 4:05 pm

Hello LW,

LW wrote: the console displays all the data I choose, but there's no highlight on the row. How can i do this?


what do you mean with "console" the LogCat :?:

Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby LW » Mon Jan 07, 2008 4:24 pm

yes the logcat, it displays the object i choose... but this is not the problem, i juste want to highlight a tableRow in a table layout


thx
LW
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Dec 31, 2007 2:05 pm

Postby plusminus » Tue Jan 08, 2008 4:09 pm

Hello LW,

don't know if there is (already) something premade, as the Focus can only be on one View.
But you could determine the TableRow "where the Focus is in" then access all Childs of this Table Row an alter teh background-color or similar...

like this:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                 TableRow tr = findViewById(...); // the selected TableRow determined somehow.
  2.  
  3.                 for(int i = 0; i < tr.getChildCount(); i++)
  4.  
  5.                         tr.getChildAt(i).setBackground(R.color.red);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Regards,
plusminus
Image
Image | Android Development Community / Tutorials
User avatar
plusminus
Site Admin
Site Admin
 
Posts: 2688
Joined: Wed Nov 14, 2007 8:37 pm
Location: Schriesheim, Germany

Postby LW » Tue Jan 08, 2008 9:40 pm

Thanks man, yeah i just tried something like this, it works.

Thx again plusminus
LW
Junior Developer
Junior Developer
 
Posts: 11
Joined: Mon Dec 31, 2007 2:05 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 17 guests