GCDiscreetNotificationView提示视图

本文介绍如何在iOS应用中使用GCDiscreetNotificationView组件实现自定义通知效果,并提供了源码及使用方法。通过在工程中引入特定的头文件和方法调用,开发者可以轻松定制通知的显示方式、内容和位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先看一下效果图:
[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



附上源码(开源中国):
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值