SORU
29 Temmuz 2011, Cuma


Genişletilebilir listesinde tüm çocuklar genişletmek görüntüleyin

Genişletilebilir liste görünümü doldurulur iken tüm çocuklar genişletmek istiyoruz. Şu anda benim kod bu gibi görünüyor:

ExpandableListView listView = (ExpandableListView) findViewById(R.id.view);
int count = viewAdapted.getGroupCount();
for (int position = 1; position <= count; position  )
    listView.expandGroup(position - 1);

oldukça çirkin olan. Hoş bunu yapmak için bir yol var mı?

CEVAP
11 Kasım 2013, PAZARTESİ


Özel adaptörü getGroupView içinde genişletmek

@Override
public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    View v = super.getGroupView(groupPosition, isExpanded, convertView, parent);
    ExpandableListView mExpandableListView = (ExpandableListView) parent;
    mExpandableListView.expandGroup(groupPosition);
    return v;
}

Gluck!

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • BgirlNilaya

    BgirlNilaya

    29 EKİM 2008
  • Jeb Corliss

    Jeb Corliss

    17 Kasım 2006
  • pendrop gaming

    pendrop gami

    4 ŞUBAT 2013