Icon and window positions shifting in OS X
The icons and window positioning in OS X can be customized in numerous ways, but in some instances these settings may revert or randomly change.
Periodically, Mac users may find that the system does not seem to recognize icon and window placement settings, and may display items in random orders and positions under certain conditions. Normally when you make a change to a Finder window layout, be it the position of items, the view setting, or the window size and location, these settings are saved; however, it appears in some instances, this may not be happening properly. A number of people who have upgraded to OS X Lion have recently found this to be an issue with their systems.
Whenever Finder window view settings do not stick, it is likely because the system is not properly interacting with the hidden ".DS_Store" files that are placed in every directory that you have interacted with using the Finder. These files contain the Finder view settings for a specific folder, and should be loaded when the folder is opened; however, the way they load in the system is conditional.
DS_Store file content is inherited, especially if you use the default single-window view in OS X where folders open in the same window, using the same view settings already present in that window. This means that when you open a new Finder window, the view settings for the default folder (usually the user's Home folder) are loaded. From here, navigating to different folders will load the .DS_Store settings for those folders (if present), but will only invoke new window settings.
For instance, if your home folder is displayed in Icon view and you browse through your Documents directory for the very first time, the .DS_Store file created by navigating to the Documents directory will be set to show the folder in the present Icon view. If you then go back to your Home folder and change the view to List, then the home folder's .DS_Store file will be altered to reflect this change; however, subsequently navigating to the Documents folder from the home directory will neither change nor load the Documents folder's previously "Icon View" settings. Instead, when navigating the initial home folder "List View" setting is inherited from the current view. If you open the Documents folder in a new window instead of the current one, then the "Icon View" settings for that folder will be loaded, but without doing this the settings for the initial window are preserved.
What this means is that .DS_Store file settings and Finder view behavior can depend on more than one .DS_Store file, so while people may assume removing the .DS_Store file from a directory that is showing view problems is the way to fix the issue, doing so may not actually fix the issue. Do try to remove the file for one directory, but if not then the next step would be to remove the .DS_Store files for the whole filesystem to prevent odd settings inheritance problems from persisting.
Unfortunately DS_Store files are hidden and will not be in every directory, so locating and removing them all manually would be a daunting task. Luckily, however, there are a number of utilities that can help in locating and removing them. Some of these are BlueHarvest, IceClean, Nude, and iRemove .DS_Store files.
When the .DS_Store files have been completely removed, log out and log back in to your system, or otherwise quit and relaunch the Finder, and check to see if the view problems persist.