---
title: "GCDiscreetNotificationView提示视图 "
author: "android_zhang"
date: "2013-06-05T11:17:37Z"
tags: []
categories: ["移动开发"]
slug: "gcdiscreetnotificationview"
draft: false
lastmod: "2013-01-14T17:23:34Z"
id: 1769571
url: "https://android-zhang.iteye.com/blog/1769571"
---

先看一下效果图：

![](http://dl.iteye.com/upload/attachment/0079/2527/e6399c81-0a7f-3faf-a87b-d48421f23b30.jpg)


<span style="color:red">注意顶部的加载提示</span>


如果打算使用这种效果，在工程中添加：GCDiscreetNotificationView.h 和 GCDiscreetNotificationView.m文件

调用方法：

ViewController.h如下：

```java
//
//  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如下：

```java
//
//  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
```



附上源码（开源中国）：