私は、アンドロイドの相対レイアウトをアクティビティにスライドさせたいと思います。 私はレイアウトを滑り落ちる以下の機能があります:あなたが最初の行にパラメータの型のViewGroup ..My質問のある見るようアンドロイドのViewGroupを参照する
public void setLayoutAnim_slidedown(ViewGroup panel, Context ctx) {
AnimationSet set = new AnimationSet(true);
Animation animation = new TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
0.0f, Animation.RELATIVE_TO_SELF, -1.0f,
Animation.RELATIVE_TO_SELF, 0.0f);
animation.setDuration(800);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
// TODO Auto-generated method stub
// MapContacts.this.mapviewgroup.setVisibility(View.VISIBLE);
}
@Override
public void onAnimationRepeat(Animation animation) {
// TODO Auto-generated method stub
}
@Override
public void onAnimationEnd(Animation animation) {
// TODO Auto-generated method stub
}
});
set.addAnimation(animation);
LayoutAnimationController controller = new LayoutAnimationController(
set, 0.25f);
panel.setLayoutAnimation(controller);
}
を私はビュー・グループを参照することができますどのようにされて...
注私は、次の
LayoutInflater inflater = (LayoutInflater) myContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.childView, null);
を試みたが、これは表示しませgroupViewを返します!
のViewGroupは、スーパークラスであるとして、あなたはいつものViewGroupにビューを型キャストすることができます。 –
別の質問...この関数を呼び出す以外に何かをしなければならないのですか?この方法でアニメーションが始まらないので何かがありませんか? – Developer