public class FirstTest extends Activity {
public FirstTest() {
// TODO Auto-generated constructor stub
}
RelativeLayout currentLayout;
static int[] Deck = {
R.drawable.img1,
R.drawable.img2,
R.drawable.img3,
R.drawable.img4
};
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
currentLayout = new RelativeLayout(this);
for (int i = 0; i < Deck.length; i++) {
ImageButton img = new ImageButton(this);
img.setPadding(0, 0, 0, 0);
img.setImageResource(Deck[i]);
img.setAdjustViewBounds(true);
img.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
// BUT HOW MOVE THIS BUTTON????
}
});
currentLayout.addView(img);
}
setContentView(currentLayout);
}
}
Maybe it's trivial for others, but I just found width and height property modifiers. After trying a lot of examples I gave up.
How can I move something? Why can't I find x y properties?