0

I'm working on a UI class for an app. The goal I'm trying to accomplish is to be able to at runtime create UI elements and add them to the layout. I then want to be able to size and move them manually (in code). For example I want to add a webview whose size is 234px by 450px and is placed at 32, 32.

Currently I'm using a relative layout and placing objects in it and then moving them around. I can move things fine by using view.setX() and view view.setY() but using the view.scaleX() and scaleY() doesn't work in the way that I want.

Should I be using a relative layout or is there another option.

I'm building for API 15

Mike
  • 147
  • 3
  • 10

1 Answers1

0

I switched to an absolute layout, though it is deprecated it allows me the exact freedom and control that I wanted.

Mike
  • 147
  • 3
  • 10
  • 1
    Terrible idea; it's deprecated for a reason. Using your method will not be multiple-device friendly and will probably, if not definitely, look horrible on other devices. I would stick with the RelativeLayout and use RelativeLayout.LayoutParams, along with FILL_PARENT/WRAP_CONTENT as needed, if you want it to look decent on devices other than your own – Cruceo Jul 13 '12 at 00:49
  • The endpoint resolution for this project will be 1920x1080 displays. – Mike Jul 14 '12 at 16:20