tags:

views:

74

answers:

1

Is there an equivalent to Java's null layout in Android? Basically I want to specify the x and y coordinates of each component and not have the layout manager choose where they go. They will be within a scroll pane so it doesn't matter whether they fit on the screen.

I know null layouts are generally not a good idea but I have a special case where I need it. I'm porting a Java TV guide app and the program grid is made up of JLabels. The program dynamically generates them all, setting the x and y coords based on start/end time and channel. Each program could start and end at any time so as far as I know a table layout won't work.

A: 

There used to be AbsoluteLayout, but it is now deprecated. The docs recommend using RelativeLayout or FrameLayout instead.

Jeff Barger
Or writing your own custom layout manager.
CommonsWare