iOS_第3方类库_BlurAlertView_GPUImage

最终效果图:

先添加GPUImage.framework

导入BlurAlertView的类声明和类实现

//
//  BlurAlertView.h
//  特效弹出框
//
//  Created by beyond on 14-10-18.
//  Copyright (c) 2014年 com.beyond All rights reserved.
//

#import <UIKit/UIKit.h>
// 必须先导入GPUImage.framework
#import <GPUImage/GPUImage.h>
@class BlurAlertView;
@protocol BlurAlertViewDelegate;

typedef NS_ENUM(NSInteger, BlurAlertViewAnimationType){
    BlurAlertViewAnimationTypeBounce,
    BlurAlertViewAnimationTypeDrop
};

typedef NS_ENUM(NSInteger, BlurAlertViewContentType){
    BlurAlertViewContentTypeText,
    BlurAlertViewContentTypeCustomView
};

@interface BlurAlertView : UIView

@property (nonatomic,strong) UIButton *okButton;
@property (nonatomic,strong) UIButton *cancelButton;
@property (nonatomic,assign) BlurAlertViewAnimationType animationType;
@property (nonatomic,weak) id<BlurAlertViewDelegate> delegate;

@property(nonatomic,copy) void(^completionBlock)(BlurAlertView *alertView,UIButton *button);

- (id)initWithTitle:(NSString *)title text:(NSString *)text cancelButton:(BOOL)hasCancelButton;
- (id)initWithTitle:(NSString *)title contentView:(UIView *)contentView cancelButton:(BOOL)hasCancelButton;
- (void)show;
- (void)dismiss;

@end

@protocol BlurAlertViewDelegate <NSObject>

@optional
-(void) alertView:(BlurAlertView *)alertView didDismissWithButton:(UIButton *)button;
-(void) alertViewWillShow:(BlurAlertView *)alertView;
-(void) alertViewDidShow:(BlurAlertView *)alertView;
-(void) alertViewWillDismiss:(BlurAlertView *)alertView;
-(void) alertViewDidDismiss:(BlurAlertView *)alertView;

@end
// 隆重介绍 使用方式
/********************Title and Text:
 BlurAlertView *alertView = [[BlurAlertView alloc] initWithTitle:@"title" text:@"this is text" cancelButton:YES color:[UIColor blueColor]];

 //set animation type
 alertView.animationType = BlurAlertViewAnimationTypeDrop;

 [alertView setCompletionBlock:^(BlurAlertView *alert, UIButton *button) {
 if (button == alert.okButton) {
 NSLog(@"ok button touched!");
 }else{
 NSLog(@"cancel button touched!");
 }
 }];
 [alertView show];
*/

/***************Custom content view:

UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 180, 180)];
contentView.backgroundColor = [UIColor blackColor];
BlurAlertView *alertView = [[BlurAlertView alloc] initWithTitle:@"title" contentView:contentView cancelButton:YES color:[UIColor blueColor]];
[alertView show];
*/
//
//  BlurAlertView.m
//  特效弹出框
//
//  Created by beyond on 14-10-18.
//  Copyright (c) 2014年 com.beyond All rights reserved.
//
static const float AlertViewTitleLabelHeight = 44.0;
static const float AlertViewSpaceHeight = 10;
static const float AlertViewDefaultTextFontSize = 16;

/*Default Colors*/
#define RJTitleLabelBackgroundColor [UIColor colorWithRed:0.20392156862745098 green:0.596078431372549 blue:0.8588235294117647 alpha:1.0]
#define RJComfirmButtonColor [UIColor colorWithRed:0.20392156862745098 green:0.596078431372549 blue:0.8588235294117647 alpha:1.0]

#define screenBounds [[UIScreen mainScreen] bounds]
#define IS_IOS7_Or_Later [[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0

#import "BlurAlertView.h"

@interface BlurAlertView ()

@property (nonatomic,strong) GPUImageiOSBlurFilter *blurFilter;
@property (nonatomic,strong) UIView *alertView;
@property (nonatomic,strong) UIImageView *backgroundView;
@property (nonatomic,strong) UILabel *titleLabel;
@property (nonatomic,strong) UILabel *textLabel;
@property (nonatomic,assign) CGSize contentSize;
@property (nonatomic,assign) BlurAlertViewContentType contentType;
@property (nonatomic,strong) UIView *contentView;
@end

@implementation BlurAlertView

- (id)initWithTitle:(NSString *)title contentView:(UIView *)contentView cancelButton:(BOOL)hasCancelButton
{
    self = [super initWithFrame:screenBounds];
    if (self) {
        self.opaque = YES;
        self.alpha = 1;
        _contentType = BlurAlertViewContentTypeCustomView;
        _contentView = contentView;
        [self _setupViewsWithTitle:title text:nil cancelButton:hasCancelButton];
    }
    return self;
}

- (id)initWithTitle:(NSString *)title text:(NSString *)text cancelButton:(BOOL)hasCancelButton
{
    self = [super initWithFrame:screenBounds];
    if (self) {
        self.opaque = YES;
        self.alpha = 1;
        _contentType = BlurAlertViewContentTypeText;
        [self _setupViewsWithTitle:title text:text cancelButton:hasCancelButton];
    }
    return self;
}

#pragma mark - Show and Dismiss
- (void)show
{
    if ([self.delegate respondsToSelector:@selector(alertViewWillShow:)]) {
        [self.delegate alertViewWillShow:self];
    }

    switch (self.animationType) {
        case BlurAlertViewAnimationTypeBounce:
            [self triggerBounceAnimations];
            break;
        case BlurAlertViewAnimationTypeDrop:
            [self triggerDropAnimations];
            break;
        default:
            break;
    }
    [[[[UIApplication sharedApplication] delegate] window] addSubview:self];
}

- (void)dismiss
{
    if ([self.delegate respondsToSelector:@selector(alertViewWillDismiss:)]) {
        [self.delegate alertViewWillDismiss:self];
    }

    [UIView animateWithDuration:0.4
                          delay:0.0
                        options: UIViewAnimationOptionCurveEaseInOut
                     animations:^{
                         self.alpha = 0;
                     }
                     completion:^(BOOL finished){
                         [self removeFromSuperview];
                         if ([self.delegate respondsToSelector:@selector(alertViewDidDismiss:)]){
                             [self.delegate alertViewDidDismiss:self];
                         }
                     }];
}

#pragma mark - Animations
- (void) triggerBounceAnimations
{

    self.alertView.alpha = 0;
    self.alertView.center = CGPointMake(CGRectGetWidth(screenBounds)/2, (CGRectGetHeight(screenBounds)/2));

    CAKeyframeAnimation * animation;
    animation = [CAKeyframeAnimation animationWithKeyPath:@"transform"];
    animation.duration = 0.3f;
    //animation.delegate = self;
    animation.removedOnCompletion = NO;
    animation.fillMode = kCAFillModeForwards;
    NSMutableArray *values = [NSMutableArray array];
    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]];
    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.2, 1.2, 1.0)]];
    [values addObject:[NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]];
    animation.values = values;
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.alertView.layer addAnimation:animation forKey:nil];

    [UIView animateWithDuration:0.3f
                          delay:0
                        options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationCurveEaseIn | UIViewAnimationOptionBeginFromCurrentState
                     animations:^{
                         [self.backgroundView setAlpha:1.0];
                         [self.alertView setAlpha:1.0];
                     }
                     completion:^(BOOL finished){
                         if ([self.delegate respondsToSelector:@selector(alertViewDidShow:)]) {
                             [self.delegate alertViewDidShow:self];
                         }
                     }];
}

-(void) triggerDropAnimations
{
    CAKeyframeAnimation * animation;
    animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
    animation.duration = 0.4f;
    //animation.delegate = self;
    animation.removedOnCompletion = NO;
    animation.fillMode = kCAFillModeForwards;
    NSMutableArray *values = [NSMutableArray array];
    [values addObject:[NSValue valueWithCGPoint:CGPointMake(screenBounds.size.width/2, -self.alertView.frame.size.height)]];
    [values addObject:[NSValue valueWithCGPoint:CGPointMake(screenBounds.size.width/2, (screenBounds.size.height/2)+self.alertView.frame.size.height*0.05)]];
    [values addObject:[NSValue valueWithCGPoint:CGPointMake(screenBounds.size.width/2, (screenBounds.size.height/2))]];
    [values addObject:[NSValue valueWithCGPoint:CGPointMake(screenBounds.size.width/2, (screenBounds.size.height/2)-self.alertView.frame.size.height*0.05)]];
    [values addObject:[NSValue valueWithCGPoint:CGPointMake(screenBounds.size.width/2, (screenBounds.size.height/2))]];
    animation.values = values;
    animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
    [self.alertView.layer addAnimation:animation forKey:nil];

    [UIView animateWithDuration:0.4 delay:0.0 options:UIViewAnimationOptionCurveEaseOut animations:^{
            self.backgroundView.alpha = 1.0;
    } completion:^(BOOL finished){
        if ([self.delegate respondsToSelector:@selector(alertViewDidShow:)]) {
            [self.delegate alertViewDidShow:self];
        }
    }];

}

#pragma mark - View Setup
- (void)_setupViewsWithTitle:(NSString *)title text:(NSString *)aText cancelButton:(BOOL)hasCancelButton
{

    [self calculateContentSize:aText];

    /*setup backgroundView*/
    _blurFilter = [[GPUImageiOSBlurFilter alloc] init];
    _blurFilter.blurRadiusInPixels = 2.0;
    _backgroundView = [[UIImageView alloc]initWithFrame:screenBounds];
    UIImage * image = [self _convertViewToImage];
    UIImage *blurredSnapshotImage = [_blurFilter imageByFilteringImage:image];
    [self.backgroundView setImage:blurredSnapshotImage];
    self.backgroundView.alpha = 0.0;
    [self addSubview:self.backgroundView];

    /*setup alertPopupView*/
    self.alertView = [self _alertPopupView];

    /*setup title and content view*/
    [self _labelSetupWithTitle:title andText:aText];
    [self addSubview:self.alertView];

    /*setup buttons*/
    [self _buttonSetupWithCancelButton:hasCancelButton];
}

- (void)_labelSetupWithTitle:(NSString*) title andText:(NSString*) text
{
    _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 180, AlertViewTitleLabelHeight)];
    _titleLabel.center = CGPointMake(CGRectGetWidth(self.alertView.frame)/2, AlertViewTitleLabelHeight/2);
    _titleLabel.text = title;
    _titleLabel.font = [UIFont fontWithName:@"HelveticaNeue-LightItalic" size:20.0f];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    [self.alertView addSubview:_titleLabel];

    if (self.contentType == BlurAlertViewContentTypeText) {
        _textLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 180, self.contentSize.height)];
        _textLabel.center = CGPointMake(self.alertView.frame.size.width/2, CGRectGetHeight(self.alertView.frame)/2);
        _textLabel.text = text;
        _textLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:AlertViewDefaultTextFontSize];
        _textLabel.textAlignment = NSTextAlignmentCenter;
        _textLabel.lineBreakMode = NSLineBreakByWordWrapping;
        _textLabel.numberOfLines = 0;
        [self.alertView addSubview:_textLabel];
    }else{
        //customView type
        self.contentView.center = CGPointMake(self.alertView.frame.size.width/2, CGRectGetHeight(self.alertView.frame)/2);
        [self.alertView addSubview:self.contentView];
    }
}

- (UIView*)_alertPopupView
{
    UIView * alertSquare = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, AlertViewTitleLabelHeight+2*AlertViewSpaceHeight+self.contentSize.height+AlertViewTitleLabelHeight)];
    alertSquare.backgroundColor = [UIColor colorWithRed:0.937 green:0.937 blue:0.937 alpha:1];
    alertSquare.center = CGPointMake(CGRectGetWidth(screenBounds)/2, CGRectGetHeight(screenBounds)/2);

    [alertSquare.layer setCornerRadius:4.0];
    [alertSquare.layer setShadowColor:[UIColor blackColor].CGColor];
    [alertSquare.layer setShadowOpacity:0.4];
    [alertSquare.layer setShadowRadius:20.0f];
    [alertSquare.layer setShadowOffset:CGSizeMake(0.0, 0.0)];

    //add top background layer
    CAShapeLayer *topBackgroundLayer = [CAShapeLayer layer];
    UIBezierPath *topBackgroundPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0,0, CGRectGetWidth(alertSquare.frame), AlertViewTitleLabelHeight) byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight cornerRadii:CGSizeMake(4.0, 4.0)];
    topBackgroundLayer.path = topBackgroundPath.CGPath;
    topBackgroundLayer.fillColor = RJTitleLabelBackgroundColor.CGColor;
    [alertSquare.layer addSublayer:topBackgroundLayer];

    return alertSquare;
}

- (void)_buttonSetupWithCancelButton:(BOOL) hasCancelButton
{
    CGFloat buttonCenterY = (CGRectGetHeight(self.alertView.frame)*2-30-AlertViewSpaceHeight)/2;
    if (hasCancelButton) {
        //ok button
        _okButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 84, 30)];
        _okButton.center = CGPointMake((CGRectGetWidth(self.alertView.frame)/4)+3, buttonCenterY);

        //cancel button
        _cancelButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 84, 30)];
        _cancelButton.center = CGPointMake((CGRectGetWidth(self.alertView.frame)*3/4)-3, buttonCenterY);
        _cancelButton.backgroundColor = [UIColor colorWithRed:0.792 green:0.792 blue:0.792 alpha:1];

        [_cancelButton setTitle:@"取消" forState:UIControlStateNormal];
        _cancelButton.titleLabel.textColor = [UIColor whiteColor];
        _cancelButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:18.0f];
		[_cancelButton addTarget:self action:@selector(handleButtonTouched:) forControlEvents:UIControlEventTouchUpInside];
        [_cancelButton.layer setCornerRadius:3.0f];
    }else{
        _okButton = [[UIButton alloc]initWithFrame:CGRectMake(0, 0, 180, 30)];
        _okButton.center = CGPointMake(CGRectGetWidth(self.alertView.frame)/2, buttonCenterY);
    }

    [_okButton setBackgroundColor:RJComfirmButtonColor];

    //ok button end setup
    [_okButton setTitle:@"确定" forState:UIControlStateNormal];
    _okButton.titleLabel.font = [UIFont fontWithName:@"HelveticaNeue" size:18.0f];
	[_okButton addTarget:self action:@selector(handleButtonTouched:) forControlEvents:UIControlEventTouchUpInside];
    [_okButton.layer setCornerRadius:3.0f];

    [self.alertView addSubview:_okButton];
    if (hasCancelButton){
        [self.alertView addSubview:_cancelButton];
    }

}

- (void)calculateContentSize:(NSString *)text
{
    UIFont *font = [UIFont fontWithName:@"HelveticaNeue" size:AlertViewDefaultTextFontSize];
    CGSize constrainedSize = CGSizeMake(180, CGFLOAT_MAX);

    if (IS_IOS7_Or_Later)
    {
        NSDictionary * tdic = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName,nil];
        self.contentSize =[text boundingRectWithSize:constrainedSize options:NSStringDrawingUsesLineFragmentOrigin |NSStringDrawingUsesFontLeading attributes:tdic context:nil].size;
    }else{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
        self.contentSize = [text sizeWithFont:font constrainedToSize:constrainedSize lineBreakMode:NSLineBreakByCharWrapping];
#pragma clang diagnostic pop
    }

    if (self.contentType == BlurAlertViewContentTypeCustomView) {
        self.contentSize = self.contentView.bounds.size;
    }
}

-(UIImage *)_convertViewToImage
{
    UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
    CGRect rect = [keyWindow bounds];
    UIGraphicsBeginImageContextWithOptions(rect.size,YES,0.0f);
    CGContextRef context = UIGraphicsGetCurrentContext();
    [keyWindow.layer renderInContext:context];
    UIImage *capturedScreen = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return capturedScreen;
}

#pragma mark - Button Action
- (void)handleButtonTouched:(UIButton *)button
{
    [self dismiss];

    if ([self.delegate respondsToSelector:@selector(alertView:didDismissWithButton:)]) {
        [self.delegate alertView:self didDismissWithButton:button];
    }

    if (self.completionBlock) {
        self.completionBlock(self,button);
    }
}

@end

主控制器,使用示例

//
//  ViewController.m
//  特效弹出框
//
//  Created by beyond on 14-10-18.
//  Copyright (c) 2014年 com.beyond All rights reserved.
//

#import "ViewController.h"

// 1导入
#import "BlurAlertView.h"
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 添加图片

    CGRect rect = CGRectMake(0, 20, 320, 460);
    UIImageView *imageView = [[UIImageView alloc]initWithFrame:rect];
    imageView.image = [UIImage imageNamed:@"1.png"];
    imageView.contentMode = UIViewContentModeScaleAspectFill;
    [self.view addSubview:imageView];

    // 添加按钮
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeContactAdd];
    btn.frame = CGRectMake(0, 40, 40, 40);
    [btn addTarget:self action:@selector(showAlertView) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    // 添加按钮2
    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeContactAdd];
    btn2.frame = CGRectMake(0, 80, 40, 40);
    [btn2 addTarget:self action:@selector(showAlertView2) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn2];

}

#pragma mark - 第3方提醒控件
- (void)showAlertView
{
    BlurAlertView *alertView = [[BlurAlertView alloc]initWithTitle:@"title" text:@"text" cancelButton:YES];

    // 设置CA动画类型
    alertView.animationType = BlurAlertViewAnimationTypeBounce;
    // BlurAlertViewAnimationTypeDrop;

    [alertView setCompletionBlock:^(BlurAlertView *alert, UIButton *button) {
        if (button == alert.okButton) {
            NSLog(@"ok button touched!");
        }else{
            NSLog(@"cancel button touched!");
        }
    }];
    [alertView show];
}
- (void)showAlertView2
{
    BlurAlertView *alertView = [[BlurAlertView alloc]initWithTitle:@"title" text:@"text" cancelButton:YES];

    // 设置CA动画类型
    // alertView.animationType = BlurAlertViewAnimationTypeBounce;
    alertView.animationType = BlurAlertViewAnimationTypeDrop;

    [alertView setCompletionBlock:^(BlurAlertView *alert, UIButton *button) {
        if (button == alert.okButton) {
            NSLog(@"ok button touched!");
        }else{
            NSLog(@"cancel button touched!");
        }
    }];
    [alertView show];
}
@end

时间: 2024-08-02 16:08:03

iOS_第3方类库_BlurAlertView_GPUImage的相关文章

iOS_第3方类库SDWebImage简单使用

1,将下载好的第3方类库SDWebImage源码包加入到工程 2,进入工程的Build Phases,将源码包里面的所有.m文件全部添加到工程 3,导入第3方类库依赖的两个系统自带的框架:MapKit.framework.ImageIO.framework 4,添加第3方类库的主头文件"UIImageView+WebCache.h" 代码使用片段: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtI

iOS_第3方类库MBprogressHUD简单使用

1,将下载好的第3方类库MBprogressHUD源码包加入到工程(其实就是一个.h和.m文件) 2,进入工程的Build Phases,将源码包里面的所有.m文件全部添加到工程 3,添加第3方类库的主头文件"MBProgressHUD.h" 显示代码: // 一开始加载就,显示提示条 MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:webView animated:YES]; // 加一层蒙版 hud.dimBackground

iOS_第3方类库_EGOImageView异步加载网络图片

异步加载网络图片是很常见的需求 下载,导入,-fno-objc-arc 1.导入头文件 2.创建EGOImageView,并指定占位图,设置url即可 最终效果图:(后补) 附EGO原文件地址:

iOS_第3方类库_側滑选项卡SlideSwitchView

终于效果: 用法: 1.在主控制器中创建一个[SlideSwitchView]的对象实例,并用成员变量记住,如_slideSwitchView,并加入到self.view 2.设置[_slideSwitchView]的4个属性: tabItemNormalColor:选项卡正常时的颜色 tabItemSelectedColor:选项卡选中时的颜色 shadowImage:盖在选项卡上面的一张图片 slideSwitchViewDelegate:设置代理为当前控制器,用于监听滑动时,切换控制器 3

IOS 编程中引用第三方的方类库的方法及常见问题

方法一:直接复制所有源文件到项目中 这种方法就是把第三方类库的所有源文件复制到项目中,直接把所有.h和.m文件拖到XCode项目中即可. 注意: 1. 如果第三方类库引用了一些系统自带类库,那么在项目中还需要额外引用那些类库. 2. 如果当前的项目启用了ARC,而引用的第三方类库未使用ARC,那还需要在项目信息的Targets – Build Parses 里找到第三方类库的.m文件,并为它们加上-fno-objc-arc标记. 3. 对于在未启用ARC的项目用引用使用了ARC的第三方类库,则需

IOS 编程中引用第三方的方类库的方法及常见问题(转载)

//原文:http://www.th7.cn/Program/IOS/201407/244585.shtml 方法一:直接复制所有源文件到项目中 这种方法就是把第三方类库的所有源文件复制到项目中,直接把所有.h和.m文件拖到XCode项目中即可. 注意: 1. 如果第三方类库引用了一些系统自带类库,那么在项目中还需要额外引用那些类库. 2. 如果当前的项目启用了ARC,而引用的第三方类库未使用ARC,那还需要在项目信息的Targets – Build Parses 里找到第三方类库的.m文件,并

iOS_第3方网络请求_YTKNetwork

github地址:https://github.com/yuantiku/YTKNetwork/blob/master/ProGuide.md YTKNetwork 是什么 YTKNetwork 是猿题库 iOS 研发团队基于 AFNetworking 封装的 iOS 网络库,其实现了一套 High Level 的 API,提供了更高层次的网络访问抽象. YTKNetwork提供了哪些功能 相比 AFNetworking,YTKNetwork 提供了以下更高级的功能: 支持按时间缓存网络请求内容

用Gradle构建Java Play框架应用

在LinkedIn,我们一直在评估最好的开发框架和工具来开发伟大的产品.11年的历史中,我们使用过很多前端web框架-如Grails.Frontier(LinkedIn内部的web框架),最近是:Play!我们喜欢Play,并热情地在公司内部推行起来.于是我们用Play进行了整合和扩展.现在我们正在评估哪个构建系统(build system,下同)更好用. 这篇文章介绍了用在Play中用Gradle来支持开发,及Gradle的目前状态和它的初步特性的演化.我们希望Play社区提供更多反馈以帮助G

js滚动分页原理

<!doctype html><html> <head> <!--声明当前页面的编码集:charset=gbk,gb2312(中文编码),utf-8国际编码--> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!--当前页面的三要素--> <title>javaWeb - 导航条</ti