0

On Android, what's a way to be able to place a view, like a WebView, anywhere on screen? I'm providing an interface to users where they can create a WebView dynamically and place it anywhere they want with X-Y and Width-Height parameters.

FrameLayout doesn't work since it sticks everything at a corner. RelativeLayout I'm not sure of. AbsoluteLayout seems like the best bet, but it's been deprecated.

djcouchycouch
  • 12,724
  • 13
  • 69
  • 108

2 Answers2

1

This answer did the trick:

Set the absolute position of a view

Community
  • 1
  • 1
djcouchycouch
  • 12,724
  • 13
  • 69
  • 108
0

You could try loading your views into Pictures and using a SurfaceView to draw them dynamically onto a Canvas. This would avoid using deprecated stuff, but to be honest I can't really see how it's any better than using an AbsoluteLayout. You would still have the problem of having to specify your position in pixel units, which is why I assume AbsoluteLayout has been deprecated.

Sam L.
  • 166
  • 2
  • 8