fixed bugs

resize wrong when change layout
change type error for a item key first time