Answers:
将的showsHorizontalScrollIndicator
和showsVerticalScrollIndicator
属性设置UIScrollView
为NO
。
[tableView setShowsHorizontalScrollIndicator:NO];
[tableView setShowsVerticalScrollIndicator:NO];
//对于UITableView-Objective-C
tbl.showsHorizontalScrollIndicator = NO;
tbl.showsVerticalScrollIndicator = NO;
//对于UITableView-SWIFT 3.0
tbl.showsHorizontalScrollIndicator = false
tbl.showsVerticalScrollIndicator = false
//对于UIScrollView-Objective-C
scrl.showsHorizontalScrollIndicator = NO;
scrl.showsVerticalScrollIndicator = NO;
//对于UIScrollView-SWIFT
scrl.showsHorizontalScrollIndicator = false
scrl.showsVerticalScrollIndicator = false
从XIB或情节提要更改
这些是您的UITableView
滚动属性:
[YourTableView setShowsHorizontalScrollIndicator:NO];
[YourTableView setShowsVerticalScrollIndicator:NO];
这些是您的UIScrollView
滚动属性:
[YourScroll setShowsHorizontalScrollIndicator:NO];
[YourScroll setShowsVerticalScrollIndicator:NO];
Swift 3.0
UIScrollView
和的扩展名UITableView
:
import Foundation
extension UIScrollView {
func hideIndicators() {
showsHorizontalScrollIndicator = false
showsVerticalScrollIndicator = false
}
}