註冊、登錄、找回密碼、修改密碼等頁面全部用 UIAlertController (AlertView) 模態彈出,層層疊加,體驗差且難以管理導航。
UIScrollView(isPagingEnabled = true,showsHorizontalScrollIndicator = false)。UIView 子視圖依次橫向排列在 ScrollView 中,寬度 = 屏寬,高度 = 屏高。- (void)showPageAtIndex:(NSInteger)index animated:(BOOL)animated {
CGPoint offset = CGPointMake(index * self.scrollView.bounds.size.width, 0);
[self.scrollView setContentOffset:offset animated:animated];
}UIPageControl)無縫配合。UIAlertController 設計用於臨時提示/確認,非完整表單頁面。每個頁面單獨 .xib,運行時 [[NSBundle mainBundle] loadNibNamed:@"LoginView" owner:nil options:nil].first 加載並 addSubview 到 ScrollView,解耦佈局代碼。