KYAsyncLoadBubble - 一個后臺加載網頁的懸浮球控件(OC)
一個后臺加載網頁的懸浮球控件。使用它,當你點擊一個鏈接之后會掛起一個懸浮球進行后臺加載,而不是粗魯地切換到加載頁面打擾用戶當前的行為。
Installation
pod 'KYAsyncLoadBubble', '~> 1.0.2'
How to use
- (IBAction)addBubble:(id)sender { for (UIView *subview in self.view.subviews) { if ([subview isKindOfClass:[KYAsyncLoadBubble class]]) { return; } } _bubble = [KYAsyncLoadBubble new]; _bubble.bubbleColor = [UIColor colorWithRed:0.0 green:0.487 blue:1.0 alpha:1.0]; _bubble.progress = 0.0; _bubble.bubbleText = @"網頁"; _bubble.delegate = self; _bubble.webUrl = @"http://kittenyang.com/deformationandgooey/"; [self.view addSubview:_bubble]; }
Then,you need to immplement the protocol method
#pragma mark -- TapBubbleDelegate -(void)bubbleDidTapped:(NSString *)webContent{ WebViewController *webVc = [[WebViewController alloc]initWithURL:_bubble.webUrl]; webVc.webContent = webContent; [self.navigationController pushViewController:webVc animated:YES]; }
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!