J'ai un RelativeLayoutComment afficher certains ImageView dans un RelativeLayout?
RelativeLayout myLayout = new RelativeLayout(this);
Puis, j'ajouter 2 ImageView dans cette mise en page:
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(20, 20);
ImageView img1 = new ImageView(this);
// Here I give the position of img1
ImageView img2 = new ImageView(this);
// And here the position and img2
myLayout.addView(img1, params);
myLayout.addView(img2, params);
setContentView(myLayout);
Et là, j'ai un problème: je veux montrer et cliquer sur les 2 ImageViews, mais seulement l'img2 est visible sur mon écran.
Y at-il un problème avec l'index z ou autre chose?
pourquoi vous ne le faire via XML? – Egor
J'utilise la bibliothèque svg-android, et apparemment, il ne permet pas d'utiliser ImageViews via un fichier XML .. – Greg