I want to make swimming pool with different partitions dynamically. All the partitions is suppose to be buttons. All the positions of the buttons will have coordinates; left,top,right and bottom. How can i setup all the buttons dynamically with java code without having problem with the Layouts. Pool & partitions could look like this Partitions Image. Maybe there is another way to solve it? Canvas?
ScrollView sv = new ScrollView(this); RelativeLayout ll = new RelativeLayout(this); sv.addView(ll); Button button = new Button(this);//Creating Button button.setPadding(0, 0, 250, 125); ll.addView(button);//Finally adding view Button button1 = new Button(this);//Creating Button button1.setPadding(250, 0, 500, 250); ll.addView(button1);//Finally adding view Button button2 = new Button(this);//Creating Button button2.setPadding(0, 125, 500, 250); ll.addView(button2);//Finally adding view Button button3 = new Button(this);//Creating Button button3.setPadding(0, 250, 500, 500); ll.addView(button3);//Finally adding view