Erweitern Sie ListView Android ändern Layout auf KlickAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 Erweitern Sie ListView Android ändern Layout auf Klick

Post by Anonymous »

Ich habe ein Android -Projekt, bei dem ich das Layout der letzten Exxpanded -Gruppe (die zusammenbricht) und der Gruppe, auf die geklickt wird, ändern muss. OngroupClick -Methode, die ich habe: < /p>

int cnt=list.getChildCount();
//set layout to all groups (for closed group)
for(int i = 0; i < cnt; i`enter code here`++){
View group = adapter.getGroupView(i, false,
null, list);
LinearLayout childLayout = (LinearLayout) group.findViewById(R.id.newsLayout); childLayout.setBackgroundResource(R.layout.group_layout_shape);
}
// set layout of clicked group
LinearLayout groupLayout = (LinearLayout) v.findViewById(R.id.newsLayout);
groupLayout.setBackgroundResource(R.layout.group_layout_opened_shape);`enter code here`
< /code>

Es ändert das Layout der geklickten Gruppe (die erweitert), ändert jedoch kein Gruppenlayout, das Colapse :( Kann Ayone mir helfen < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post