Reputation: 1549
I have an issue : this issue could be understood by following example.
The screen uses three views lets say A,B,C. A is set for Drag and drop on B. What I want is when A is being dragged to B , A should overlap C view but B should overlap A.This makes it three layers B on top,A in middle and C lowest layer.
I dont know how to do this ,with two views it could be implemented but with three how can I solve this Problem.
If anyone cant understand my problem please let me know?Please help?
Upvotes: 0
Views: 543
Reputation: 1549
Solved my own problem :
Used bringToFront() method in the same sequence I want the views
A.bringToFront();
B.bringToFront();
Upvotes: 1
Reputation: 2534
I think you need to add views dynamically.Try this.
RelativeLayout rLayout = (RelativeLayout)findViewById(R.id.your_id);
Button btn = new Button(this);
btn.setText("Button Name"); // Similarly set different property for the button.
Finally you have to add this button to the respective layout.
rLayout.addView(btn);
Upvotes: 1