如何在iPhone程序读取数据时显示进度窗
2009-06-22 14:13
621 查看
下面代码说明如何使用iPhone 非官方SDK在读取数据时显示进度条。 以下代码参考了MobileRss。 定义头文件: #import uikit/UIProgressHUD.h @interface EyeCandy : UIApplication { UIProgressHUD * progress; } - ( v
下面代码说明如何使用iPhone 非官方SDK在读取数据时显示进度条。
以下代码参考了MobileRss。
定义头文件:
#import "uikit/UIProgressHUD.h"
@interface EyeCandy : UIApplication {
UIProgressHUD *progress;
}
- (void) showProgressHUD:(NSString *)label withWindow:(UIWindow *)w withView:(UIView *)v withRect:(struct CGRect)rect;
- (void) hideProgressHUD;
@end
上面的引号要改成<>。
import "EyeCandy.h"
@implementation EyeCandy
- (void)showProgressHUD:(NSString *)label withWindow:(UIWindow *)w withView:(UIView *)v withRect:(struct CGRect)rect
{
progress = [[UIProgressHUD alloc] initWithWindow: w];
[progress setText: label];
[progress drawRect: rect];
[progress show: YES];
[v addSubview:progress];
}
- (void)hideProgressHUD
{
[progress show: NO];
[progress removeFromSuperview];
}
@end
使用下面代码调用:
// Setup Eye Candy View
_eyeCandy = [[[EyeCandy alloc] init] retain];
// Call loading display
[_eyeCandy showProgressHUD:@"Loading …" withWindow:window withView:mainView withRect:CGRectMake(0.0f, 100.0f, 320.0f, 50.0f)];
// When finished for hiding the "loading text"
[_eyeCandy hideProgressHUD];
下面代码说明如何使用iPhone 非官方SDK在读取数据时显示进度条。
以下代码参考了MobileRss。
定义头文件:
#import "uikit/UIProgressHUD.h"
@interface EyeCandy : UIApplication {
UIProgressHUD *progress;
}
- (void) showProgressHUD:(NSString *)label withWindow:(UIWindow *)w withView:(UIView *)v withRect:(struct CGRect)rect;
- (void) hideProgressHUD;
@end
上面的引号要改成<>。
import "EyeCandy.h"
@implementation EyeCandy
- (void)showProgressHUD:(NSString *)label withWindow:(UIWindow *)w withView:(UIView *)v withRect:(struct CGRect)rect
{
progress = [[UIProgressHUD alloc] initWithWindow: w];
[progress setText: label];
[progress drawRect: rect];
[progress show: YES];
[v addSubview:progress];
}
- (void)hideProgressHUD
{
[progress show: NO];
[progress removeFromSuperview];
}
@end
使用下面代码调用:
// Setup Eye Candy View
_eyeCandy = [[[EyeCandy alloc] init] retain];
// Call loading display
[_eyeCandy showProgressHUD:@"Loading …" withWindow:window withView:mainView withRect:CGRectMake(0.0f, 100.0f, 320.0f, 50.0f)];
// When finished for hiding the "loading text"
[_eyeCandy hideProgressHUD];
相关文章推荐
- 如何在iPhone程序读取数据时显示进度窗
- iPhone程序读取数据时显示进度窗
- 复制文件时,如何显示进度条(使用BlockRead函数读取数据,并插入application.ProcessMessages)
- 如何解决从mysql中读取数据时显示为乱吗的问题.
- nodejs如何动态读取文件夹下图片,并放入json数据中并显示
- MFC_如何连接Access数据库_读取出的数据显示在树上
- C#程序中:如何向xml文件中写入数据和读取数据
- Sqlite数据库及在iOS程序中如何写入和读取数据库数据
- iphone Documents文件中保存的图片如何读取并显示?
- SerialPort如何读取串口数据并显示在TextBox上,多线程委托
- 微信小程序如何与java后台交互,获取json数据显示到页面,求大神指点
- SerialPort如何读取串口数据并显示在TextBox上,多线程委托
- 如何读取xml数据并显示在html页面
- ztree备忘笔记,读取数据(并解决了如何控制修改和移出按钮是否显示)
- 如何将pictureBox里的图片保存到数据库,然后从数据读取显示
- 如何编写一个能读取Powerbuilder的数据窗口中数据的程序
- SerialPort如何读取串口数据并显示在TextBox上,多线程委托
- C#如何从数据库里读取iamge类型的数据,让其显示在pictureBox里(整理)
- 第4章 处理用户输入与显示数据------------(读取参数、读取程序名称、测试参数)
- C#如何读取Excel表格数据并显示到GridView控件