先看一下效果图:
[img]
[img]http://dl.iteye.com/upload/attachment/0079/2527/e6399c81-0a7f-3faf-a87b-d48421f23b30.jpg[/img]
[/img]
[color=red]注意顶部的加载提示[/color]
如果打算使用这种效果,在工程中添加:GCDiscreetNotificationView.h 和 GCDiscreetNotificationView.m文件
调用方法:
ViewController.h如下:
ViewController.m如下:
附上源码(开源中国):
[img]
[img]http://dl.iteye.com/upload/attachment/0079/2527/e6399c81-0a7f-3faf-a87b-d48421f23b30.jpg[/img]
[/img]
[color=red]注意顶部的加载提示[/color]
如果打算使用这种效果,在工程中添加:GCDiscreetNotificationView.h 和 GCDiscreetNotificationView.m文件
调用方法:
ViewController.h如下:
//
// ViewController.h
// TestToast
//
// Created by 张 志亮 on 13-1-14.
// Copyright (c) 2013年 张 志亮. All rights reserved.
//
#import <UIKit/UIKit.h>
@class GCDiscreetNotificationView;
@interface ViewController : UIViewController
@property(nonatomic,retain)GCDiscreetNotificationView *notificationView;
@end
ViewController.m如下:
//
// ViewController.m
// TestToast
//
// Created by 张 志亮 on 13-1-14.
// Copyright (c) 2013年 张 志亮. All rights reserved.
//
#import "ViewController.h"
#import "GCDiscreetNotificationView.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize notificationView;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// if inPresentationMode: is no The notification will on top
// if inPresentationMode: is yes the notification will on bottom
notificationView = [[GCDiscreetNotificationView alloc] initWithText:@"notification"
showActivity:YES
inPresentationMode:NO
inView:self.view];
[self.notificationView show:YES];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
附上源码(开源中国):