fixed rotation issue in iOS8, compatible with iOS7