When a Mini Program starts, the container displays a loading page if the program is not yet on the device. The user waits while the Mini Program installs. After the installation is complete, the loading page closes, and the Mini Program opens.

Implement a custom loading page
For iOS Mini Programs, mPaaS lets you customize the content of the loading page. Follow these steps to configure the page:
Create a child class that inherits from
APBaseLoadingViewto define your custom loading page view. In this class, modify the style of the view.
The following code is an example:
@interface MPBaseLoadingView : APBaseLoadingView @end @implementation MPBaseLoadingView - (instancetype)init { self = [super init]; if (self) { self.backgroundColor = [UIColor grayColor]; self.titleLabel.backgroundColor = [UIColor redColor]; self.titleLabel.font = [UIFont boldSystemFontOfSize:8]; self.iconImageView.backgroundColor = [UIColor blueColor]; self.pageControl.backgroundColor = [UIColor orangeColor]; } return self; } - (void)layoutSubviews { [super layoutSubviews]; // Adjust the position of the view CGSize size = self.bounds.size; CGRect frame = CGRectMake((size.width - 80)/2, 0, 80, 80); self.iconImageView.frame = frame; frame = CGRectMake(15, CGRectGetMaxY(self.iconImageView.frame) + 6, size.width - 30, 22); self.titleLabel.frame = frame; frame = CGRectMake((size.width-40)/2, CGRectGetMaxY(self.titleLabel.frame) + 21, 40, 20); self.pageControl.frame = frame; } @endIn the category for the
DTFrameworkInterfaceclass, override thebaseloadViewClassmethod to return the class name of your custom loading page view.- (NSString *)baseloadViewClass { return @"MPBaseLoadingView"; }
该文章对您有帮助吗?