KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I want to add a view inside a FrameLayout programmatically and to place it in a specific point within the layout with a specific width and height. Does FrameLayout support this? If not, should I use an intermediate ViewGroup to achieve this? int x; // Can be negative? int y; // Can be negative? int width; int height; View v = new View(context); // v.setLayoutParams(?); // What do I put here? frameLayout.addView(v); My initial idea was to add an AbsoluteLayout to the FrameLayout and place the view inside the AbsoluteLayout. Unfortunately I just found out that AbsoluteLayout is deprecated. Any pointers will be much appreciated. Thanks.
Tags (comma-separated)
Save Edits
Cancel