隐藏HomeIndicator

手动隐藏
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@property(nonatomic,assign)BOOL isHiddenHomeIndicator;

self.isHiddenHomeIndicator=YES;

或者

self.isHiddenHomeIndicator=NO;

if (@available(iOS 11.0, *))
{
[self setNeedsUpdateOfHomeIndicatorAutoHidden];
}

- (BOOL)prefersHomeIndicatorAutoHidden
{
return self.isHiddenHomeIndicator;
}

自动隐藏
1
2
3
4
- (BOOL)prefersHomeIndicatorAutoHidden
{
return YES;
}