[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
AndroidGreece.gr - View topic - Custom ListView με seperators
View unanswered posts | View active topics It is currently 28 Mar 2024, 13:49



Reply to topic  [ 4 posts ] 
 Custom ListView με seperators 
Author Message

Joined: 21 Sep 2012, 10:24
Posts: 10
Post Custom ListView με seperators
Καλησπέρα θέλω να φτιάξω μια λίστα με 3 διαφορετικά items.

a) Το πρώτο είναι TextView και EditText
b) Το άλλο είναι TextView και RatingBar
c) Και το άλλο είναι TextView και 2 CheckBox.

d)Και οι seperators.

Ανάλογα με ένα id που παίρνω τα εκτυπώνω σε ListView πχ.

d)
a)
b)
a)
d)
c)
c)

Το έχω καταφέρει αυτό. Πώς μπορώ να παίρνω την τιμή του position τησ λίστας ότνα κάνω click σε ένα item (o onItemClickListener δεν δουλεύει όταν κάνω click στο RatingBox ή στο check box).
Έχει κανείς καμιά ιδέα??


04 Oct 2012, 17:45
Profile

Joined: 29 Jun 2012, 02:45
Posts: 21
Post Re: Custom ListView με seperators
Ο onItemClickListener δουλεύει για το αντικείμενο του ListView όχι για αυτα που περιέχει!


08 Oct 2012, 12:50
Profile

Joined: 09 Oct 2012, 13:04
Posts: 2
Post Re: Custom ListView με seperators
καλησπέρα σε όλους,
Βασικά για να παίρνουν τα events τα αλλα αντικείμενα της λίστας σου πρέπει να δηλώσεις το ListView focusable =false.
Μετά θα μπορείς να κάνεις κανονικά κλικ πάνω στα κουμπιά άλλα items. Ο τρόπος για να βρείς ποιο checkbox έγινε κλικ είναι
λίγο περίεργος (τουλάχιστον όπως το έχω κάνει εγώ!!) :
μπορείς στον Adapter που έχεις φτιάξει σε κάθε κλήση της getView() να δίνεις ένα TAG στα checkboxes που θα είναι ουσιαστικά
το position της συγκεκριμένης γραμμής της λίστας. Οπότε μόλις
το checkBox αλλάξει state θα μπορείς να βρείς το tag του να το μετατρέψεις σε int και άρα ετσι να έχεις και το position.
Ελπίζω να βοήθησα. Αμα έχεις κι άλλη απορία θα χαρώ να βοηθήσω.


19 Oct 2012, 14:31
Profile

Joined: 09 Aug 2012, 13:03
Posts: 17
Post Re: Custom ListView με seperators


15 Feb 2013, 21:48
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 38 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.