mbprogresshud

MBProgressHUD with CustomView: Why can't I animate my custom view?

﹥>﹥吖頭↗ 提交于 2021-01-29 09:50:58
问题 This somehow doesn't work...why? How can I achieve a spinning custom propeller without making a gif out of the animation? -(UIView *)propTest { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 37, 37)]; UIImageView *movablePropeller = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 37 , 37)]; movablePropeller.image = [UIImage imageNamed:@"MovablePropeller"]; [view addSubview:movablePropeller]; movablePropeller.center = view.center; CABasicAnimation *rotation; rotation =

AFNetworking封装-项目使用

烂漫一生 提交于 2020-04-24 17:47:26
本篇博客是接着上一篇AFNetworking源码解析的后续,如果想对AFNetworking源码有所了解。 请读一下 https://www.cnblogs.com/guohai-stronger/p/9191497.html 。 YTKNetwork的源码详解: https://www.cnblogs.com/guohai-stronger/p/9194519.html 这篇博客主要是对AFNetworking代码进行封装,也是自己在实际项目中所使用过的(对中小型企业或者项目)可直接使用,也会在github上传(偷偷窃喜一下,一直想在github上有所项目,一直没有时间),趁着端午几天有时间,给github贡献点自己力量。本篇读下来大约10-15分钟,欢迎指正。 一.结构解析 最核心(可直接拖拽到新项目中) (拓展cocoapods的拖入) 拖入之前,需要导入AFNetworking,最好利用cocoapods导入,cocoapods导入时 vim Podfile --->输入i platform :ios, ' 8.0 ' target " targetName " do pod ' AFNetworking ' end (有一点在 然后按Esc,并且输入“ :”号进入vim命令模式,然后在冒号后边输入wq )最后pod install。编译一下,拖入项目的类就好了

IOS-CocoaPods

戏子无情 提交于 2020-03-19 02:55:35
一、概要 iOS开发时,项目中会引用许多第三方库,CocoaPods(https://github.com/CocoaPods/CocoaPods) 可以用来方便的统一管理这些第三方库。 二、安装 由于网上的教程基本都大同小异,但细节之处还不是很完善,所以借机会在这里补充下: 注:要使用CocoaPods,那就要下载安装它,而下载安装CocoaPods需要Ruby环境 1、Ruby环境搭建 Mac OS本身自带Ruby,但还是更新一下保险. a查看下当前ruby版本:打开终端输入 ruby -v(确实安装了,不过用这个版本接下来工作失败了,所以更新下ruby) // ruby -v 终端显示结果 ruby 2.0.0p645 (2015-04-13 revision 50299) [universal.x86_64-darwin15] b更新ruby 终端输入如下命令(把Ruby镜像指向taobao,避免被墙,你懂得) gem sources --remove https://rubygems.org/ gem sources -a https://ruby.taobao.org/ gem sources -l (用来检查使用替换镜像位置成功) 2、下载安装CocoaPods 终端输入:sudo gem install cocoapods 最终出现: 8 gem installed

MBProgressHUD上传照片进度提示

我只是一个虾纸丫 提交于 2020-03-17 02:47:13
第一步,控制器先来个属性 @property (strong, nonatomic) MBProgressHUD *HUD; 第二步,显示与隐藏的调用方法 - (void)hudTipWillShow:(BOOL)willShow{ if (willShow) { [self resignFirstResponder]; UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow; if (!_HUD) { _HUD = [MBProgressHUD showHUDAddedTo:keyWindow animated:YES]; _HUD.mode = MBProgressHUDModeDeterminateHorizontalBar; _HUD.labelText = @"正在上传图片..."; _HUD.removeFromSuperViewOnHide = YES; }else{ _HUD.progress = 0; [keyWindow addSubview:_HUD]; [_HUD show:YES]; } }else{ [_HUD hide:YES]; } } 第三步,上传前,让其显示 [self hudTipWillShow:YES]; 第四步,上传中,进度提示 if (self.HUD) {

iOS开发实践之GET和POST请求

我的未来我决定 提交于 2020-02-25 11:48:13
GET和POST请求是HTTP请求方式中最最为常见的。 在说请求方式之前先熟悉 HTTP 的通信过程: 请求 1 、 请求行 : 请求方法、请求路径、 HTTP 协议的版本号 GET /MJServer/resources/images/ 1. jpg HTTP/ 1.1 2、请求头 : client的一些描写叙述信息 Host : 192.168.1.111:8080 // client想訪问的server主机地址 User-Agent : Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9) Firefox/30.0 // client的类型,client的软件环境 Accept : text/html, // client所能接收的数据类型 Accept-Language : zh-cn // client的语言环境 Accept-Encoding : gzip // client支持的数据压缩格式 3、请求体 : POST 请求才有这个东西 请求參数,发给server的数据 响应 1、状态行(响应行) : HTTP 协议的版本号、响应状态码、响应状态描写叙述 Server : Apache-Coyote/1.1 // server的类型 Content-Type : image/jpeg // 返回数据的类型 Content-Length

iOS - Globally change MBProgressHUD design

天涯浪子 提交于 2020-01-25 20:44:07
问题 I use MBProgressHUD for loading screens in my app. I have 26 occurrences where I use a different HUD. Now, I've decided to use a customised UIView (an animated UIImageView) for the HUD. I want to apply this to all the HUD's I use in my app, but the code to customise the HUD is about 15 lines long, and it's definitely not the right method to add this code to every single occurrence of a MBProgressHUD in my app. What's the right way to go from here? This is not the first time I've run into an

Cocoapods遇到CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs...

拟墨画扇 提交于 2020-01-18 15:10:18
最近自己做了一个cocoapod库,代码改好了,先本地验证一下podspec pod lib lint MWPhotoBrowser.podspec --use-libraries --allow-warnings 报错了 e failed - 10 error(s): CDN: trunk URL couldn't be downloaded: https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/c/8/7/MBProgressHUD/0.5/MBProgressHUD.podspec.json, error: Failed to open TCP connection to raw.githubusercontent.com:443 (Connection refused - connect(2) for "raw.githubusercontent.com" port 443) 。。。 原因出在MWPhotoBrowser引用了另一个库MBProgressHUD,验证的过程中,需要下载MBProgressHUD,下载失败了。 为什么会失败呢?因为我现在用的cocoapods版本是1.8.4,默认的源是这个 trunk - Type: CDN - URL: https://cdn.cocoapods

MBProgressHUB mixed View

萝らか妹 提交于 2020-01-06 08:49:34
问题 - (void) didClickDone{ if (isValide ==0) { (...) [newFormDataRequest setDelegate:self]; [newFormDataRequest startAsynchronous]; (...) //show the label [self showWithLabel]; } } # pragma mark - AsiHTTPRequest delegate methods - (void)requestFinished:(ASIHTTPRequest *)request { NSLog(@"PostAdRequest = %@", [request responseString]); HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease]; HUD.mode = MBProgressHUDModeCustomView; HUD.labelText

MBProgressHUD and UITableView

☆樱花仙子☆ 提交于 2020-01-03 09:07:27
问题 I am displaying a HUD while populating the TableView, but it seems to be showing behind the TableView (tableview separator breaking the hud). Here's the code in the TableViewController: - (void)viewDidLoad { [super viewDidLoad]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = @"Loading"; // Populate the table [self getTableData]; self.tableView.rowHeight = 90; } It's doing this only with TableViews. 回答1: The issue

MBProgressHUD and UITableView

会有一股神秘感。 提交于 2020-01-03 09:07:09
问题 I am displaying a HUD while populating the TableView, but it seems to be showing behind the TableView (tableview separator breaking the hud). Here's the code in the TableViewController: - (void)viewDidLoad { [super viewDidLoad]; MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText = @"Loading"; // Populate the table [self getTableData]; self.tableView.rowHeight = 90; } It's doing this only with TableViews. 回答1: The issue