我有一个用例,这些指标会干扰用户交互。我可以子类化和覆盖方法或执行类似的操作从滚动视图中删除滚动指示符吗?
答案 0 :(得分:254)
将showsHorizontalScrollIndicator
的{{1}}和showsVerticalScrollIndicator
属性设置为UIScrollView
。
NO
答案 1 :(得分:49)
//对于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或故事板改变
答案 2 :(得分:14)
对于那些希望在Swift中做到这一点的人。
self.tableView.showsHorizontalScrollIndicator = false
self.tableView.showsVerticalScrollIndicator = false
答案 3 :(得分:8)
对于Swift中的UIScrollView
scrollView?.showsHorizontalScrollIndicator = false
scrollView?.showsVerticalScrollIndicator = false
答案 4 :(得分:4)
这些是您的UITableView
滚动属性:
[YourTableView setShowsHorizontalScrollIndicator:NO];
[YourTableView setShowsVerticalScrollIndicator:NO];
这些是您的UIScrollView
滚动属性:
[YourScroll setShowsHorizontalScrollIndicator:NO];
[YourScroll setShowsVerticalScrollIndicator:NO];
答案 5 :(得分:1)
boardSize
和static ArrayList<Knight> knightsOnBoard = new ArrayList<Knight>();
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int boardSize = s.nextInt();
int knights = s.nextInt();
for (int i = 0; i < knights; i++) {
int x = (s.next().charAt(0) - 'a') + 1;
int y = s.nextInt();
Knight newKnight = new Knight(new Position(x,y), boardSize);
knightsOnBoard.add(newKnight);
System.out.println("Knight at : " + newKnight.knightPosition.x + " " + newKnight.knightPosition.y);
}
ArrayList<Position> finalResults = GetAllDifferentPositions();
RemoveAllKnightPositions(finalResults);
System.out.println("Positions: " + (finalResults.size() + knightsOnBoard.size()));
s.close();
}
的 Swift 3.0
扩展名:
UIScrollView
答案 6 :(得分:0)