-
Notifications
You must be signed in to change notification settings - Fork 473
Setup Control Layer View
changsanjiang edited this page Oct 20, 2019
·
1 revision
The default edge control layer has top, left, bottom, right, center
adapters, as follows:
You can add, remove, update
items of any adapter.
static SJEdgeControlButtonItemTag const SJDemoButtonItemTag = 100;
// Add item to top adapter
{
SJEdgeControlButtonItem *item = [[SJEdgeControlButtonItem alloc] initWithImage:[UIImage imageNamed:@"img_play"] target:self action:@selector(test) SJDemoButtonItemTag];
[_player.defaultEdgeControlLayer.topAdapter addItem:item];
[_player.defaultEdgeControlLayer.topAdapter reload];
}
// Remove
{
[_player.defaultEdgeControlLayer.topAdapter removeItemForTag:SJDemoButtonItemTag];
[_player.defaultEdgeControlLayer.topAdapter reload];
}
// Update
{
SJEdgeControlButtonItem *item = [_player.defaultEdgeControlLayer.topAdapter itemForTag:SJDemoButtonItemTag];
// item.title = ...;
// item.hidden = ...;
item.image = ...;
[_player.defaultEdgeControlLayer.topAdapter reload];
}
SJEdgeControlLayer *controlLayer = self.player.defaultEdgeControlLayer;
controlLayer.hiddenBackButtonWhenOrientationIsPortrait = YES;
controlLayer.showResidentBackButton = YES;
controlLayer.disabledPromptWhenNetworkStatusChanges = NO;
controlLayer.showNetworkSpeedToLoadingView = YES;
controlLayer.hiddenBottomProgressIndicator = NO;
controlLayer.bottomProgressIndicatorHeight = 3.0;