If the sections you are showing and hiding are in a layout table, make sure the row is set to automatically size. Look in the Table Properties, and check your row heights. If they are in another section, be sure the section is set to auto for the height -- that is in Section Properties, under Size.