2012-03-15 4 views
0

私のExpandableListViewの任意の子で2つのビュー(私のViewSwitcherから)を正しく置き換えることはできません。レイアウトを変更する子は常に画面に最初に表示されます(最初のグループの最初の子、または2番目のグループの3番目の子になることができます)。ExpandableListViewの子でViewSwitcherを使用する

これは私のコードです

私は次のコードにChildClickイベントを変更した場合
protected override void OnCreate(Bundle bundle) 
{ 
     base.OnCreate(bundle); 

     this.SetContentView(Resource.Layout.main); 


     ExpandableListView elv = (ExpandableListView)FindViewById(Resource.Id.ExpandableListView01); 

     loadData(); 

     MyExpandableAdapter adapter = new MyExpandableAdapter(this, groups, childs); 
     elv.SetAdapter(adapter); 



     elv.ChildClick += (object sender, Android.Widget.ExpandableListView.ChildClickEventArgs e) => 
     { 
      ViewSwitcher vs = FindViewById<ViewSwitcher>(Resource.Id.details2); 
      vs.InAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.fade); 
      vs.ShowNext();    

     }; 
} 

はまた、「フェード」アニメーションは正しい子で使用されますが、私はViewSwitcherでレイアウトを使用されることはありませんので、私はそれをどのように行うことができますか?

elv.ChildClick += (object sender, Android.Widget.ExpandableListView.ChildClickEventArgs e) => 
      { 
       Animation animation = AnimationUtils.LoadAnimation(this, Resource.Animation.fade); 

       e.V.StartAnimation(animation) ;   

      }; 
    } 

答えて

0

私は自分自身に答える。

elv.ChildClick += (object sender, Android.Widget.ExpandableListView.ChildClickEventArgs e) => 
{ 

    ViewSwitcher vs = (ViewSwitcher)e.V; 
    vs.InAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.fade); 

    vs.ShowNext(); 


}; 
関連する問題