Ich habe ein relatives Layout, in dem ich ein zweites relatives Layout hinzufüge, das 4 Knöpfe enthält. Wenn ich es tue: relativeLayout1.addView(relativeLayout2,params)
Ich möchte, dass das hinzugefügte relative Layout mit den 4 Tasten von rechts nach links gleitet.Wie wird das relative Layout zum relativen Layout mit aktivierter Folie hinzugefügt?
Ist das irgendwie möglich?
xml:
<translate xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:fromXDelta="100%" android:toXDelta="0%" > </translate>
Code: `` `
public Panel(Context context) {
super(context);
this.setBackgroundColor(Color.BLACK);
this.setId(R.id.panel);
right_menubar = new RelativeLayout(context);
right_menubar.setId(R.id.panel_indicators);
plp_right_menu_bar = new RelativeLayout.LayoutParams(100, 100);
this.addView(right_menubar, plp_right_menu_bar);
Animation fadeIn = AnimationUtils.loadAnimation(context, R.animator.anim);
right_menubar.startAnimation(fadeIn);
}
Sie sollten einen Blick auf [TranslateAnimation] (http://developer.android.com/reference/android/view/animation/TranslateAnimation.html) – Titus
http://stackoverflow.com/questions/20696801/how- To-make-a-rechts-nach-links-Animation-in-einem-Layout –
Es funktioniert nicht. Muss ich 'relativeLayout2.startAnimation (Animation) 'nach' relativeLayout1.addView (relativeLayout2, params) 'aufrufen? –