Question

I am creating an Android app in Eclipse, but when I drag around a TextView, everything below it moves around as well.



This is when I haven't dragged anything.
http://i.stack.imgur.com/Twp4L.png

This is when I drag the TextView just a bit.
http://i.stack.imgur.com/oJ75k.png

Was it helpful?

Solution

The layout designer doesn't work very well in Eclipse. You could try Android Studio's layout designer (the new early access preview), that one is a bit better, but not by much.

The most common practice is to use the layout designer to only get started with and perhaps to use the Outline view panel to tweak some of the nesting of the layouts/views by dragging some of the nodes inside it, but then it's to dive directly into the xml code yourself. There is really no other substitute for doing that. The tool just isn't very good yet.

OTHER TIPS

This is called a Relative Layout. In this case, the components are placed relative to the TextView, which is not so unexpected. It depends how you set relations in the layout XML. What layout you want to achieve?

You can either set that all the components are placed relative to the whole view, or use some specialized layout types like LinearLayout. It all depends on the effect you want to achieve.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top