[tableView flashScrollIndicators]; // 內建方法,自動顯示後淡出
tableView.showsVerticalScrollIndicator = YES;
// 水平
tableView.showsHorizontalScrollIndicator = YES;
// 僅支援垂直指示器
tableView.verticalScrollIndicatorInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0);
// 寬度 (私有 API,不建議上架)
[tableView setValue:@(4) forKey:@"verticalScrollIndicatorWidth"];
// 顏色 (需自訂 UIView 覆蓋或使用第三方庫)
showsVerticalScrollIndicator = NO。UIScrollViewDelegate 的 scrollViewDidScroll: 計算進度。UIView 作為指示器,支援圓角、顏色、寬度、點擊跳轉。pod 'SCPageControl'、pod 'CustomScrollIndicator' 等提供豐富樣式。