Giter Site home page Giter Site logo

yiplee / ypnavigationbartransition Goto Github PK

View Code? Open in Web Editor NEW
829.0 12.0 98.0 8.79 MB

A Full functional UINavigationBar framework for making bar transition more natural! You don't need to call any UINavigationBar api, implementing YPNavigationBarConfigureStyle protocol for your view controller instead. (类似微信 iOS Navigation Bar 的切换方案)

License: MIT License

Objective-C 95.99% Ruby 3.48% Shell 0.53%
navigationbar transition statusbar uinavigationcontroller navigation bar transparent translucent swift

ypnavigationbartransition's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ypnavigationbartransition's Issues

如何在Translucent时排除状态栏?

  • (YPNavigationBarConfigurations) yp_navigtionBarConfiguration {
    return YPNavigationBarBackgroundStyleTranslucent | YPNavigationBarBackgroundStyleColor;
    }

  • (UIColor *) yp_navigationBarTintColor {
    return [UIColor redColor];
    }

  • (UIColor *) yp_navigationBackgroundColor {
    return [UIColor whiteColor];
    }

目前视图向上滚动时会出现在naviagtionbar和statusbar下面,如何排除statusbar使Translucent效果只出现在naviagtionbar?

How to use with subclass of UINavigationController?

Follow the instruction of YPNavigationController, but method validateInnerNavigationDelegate and variable navigationController does not exist. So what should i do if i want to make a UINavigatioController subclass to use in the project?

yp_navigationBackgroundImageWithIdentifier 咨询

  • (UIImage *) yp_navigationBackgroundImageWithIdentifier:(NSString *__autoreleasing *)identifier {
    if (identifier) *identifier = _backgroundImageName;
    return _backgroundImage;
    }
    swift 语法 if (identifier) *identifier = _backgroundImageName; 该如何写呢?

swift can not use styleLight

public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
return [.styleLight]
}

.styleLight 无效

iOS13暗黑模式

请问大佬啥时候可以更新暗黑模式呀?我看状态栏新增了UIStatusBarStyleDarkContent这个模式

为什么不透明的时候不能设置图片和背景颜色

   if (!(configurations & YPNavigationBarBackgroundStyleTransparent)) {
        if (configurations & YPNavigationBarBackgroundStyleImage) {
            backgroundImage = [owner yp_navigationBackgroundImageWithIdentifier:&imageIdentifier];
        } else if (configurations & YPNavigationBarBackgroundStyleColor) {
            backgroundColor = [owner yp_navigationBackgroundColor];
        }
   }

设置 extendedLayoutIncludesOpaqueBars 为 true 还是会引起 tableView 跳动一下

A push B

全局默认设置:
extension YPNavigationController : NavigationBarConfigureStyle {
public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
return [.backgroundStyleColor, .backgroundStyleOpaque]
}

public func yp_navigationBarTintColor() -> UIColor! {
return UIColor.white
}

public func yp_navigationBackgroundColor() -> UIColor! {
return Specs.color.tint
}
}

A 设置: (设置 extendedLayoutIncludesOpaqueBars 为 true )
extension A : NavigationBarConfigureStyle {
public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
return [.backgroundStyleTransparent]
}

public func yp_navigationBarTintColor() -> UIColor! {
return UIColor.white
}
}

B 设置:

extension B : NavigationBarConfigureStyle {
public func yp_navigtionBarConfiguration() -> YPNavigationBarConfigurations {
return [.backgroundStyleColor, .backgroundStyleOpaque]
}

public func yp_navigationBarTintColor() -> UIColor! {
return UIColor.white
}

func yp_navigationBackgroundColor() -> UIColor! {
return UIColor(hex: 0x40362E)
}
}

iOS 13下,设置tintColor失效

条件:当视图控制器不使用titleLabel,直接设置self.title时
现象:字体颜色会是黑色
情况说明:代理中设置的tintColor(白色)失效。

2.0.9 版本第一次切换闪烁

在2.0.9版本中,第一次从图片切换到背景颜色会导致导航栏闪烁,之后就不会了,而在2.0.8中没有这种问题,希望能改进下

新版模态方式,会引起闪退

不是全屏的模态,模态界面下拉再回弹会crash

[toVC.view removeObserver:self
forKeyPath:NSStringFromSelector(@selector(bounds))
context:&ctx];

这里移除了不存在的观察者
新版的模态不走willshow代理

使用这个框架后代码强制横屏失败

AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
// 打开横屏开关
appDelegate.allowRotation = YES;
// 调用转屏代码
[UIDevice deviceMandatoryLandscapeWithNewOrientation:UIInterfaceOrientationLandscapeRight];

/// 输入要强制转屏的方向
/// @param interfaceOrientation 转屏的方向

  • (void)deviceMandatoryLandscapeWithNewOrientation:(UIInterfaceOrientation)interfaceOrientation {

    NSNumber *resetOrientationTarget = [NSNumber numberWithInt:UIInterfaceOrientationUnknown];

    [[UIDevice currentDevice] setValue:resetOrientationTarget forKey:@"orientation"];

    // 将输入的转屏方向(枚举)转换成Int类型
    int orientation = (int)interfaceOrientation;

    // 对象包装
    NSNumber *orientationTarget = [NSNumber numberWithInt:orientation];

    // 实现横竖屏旋转
    [[UIDevice currentDevice] setValue:orientationTarget forKey:@"orientation"];
    }

Example for Swift

Unfortunately I can not figure out how to use your library in Swift. If possible, rewrite the same example on Swift.

self.navigationItem.rightBarButtonItem设置后未生效

A页面push到B页面, 在B页面中设置self.navigationItem.rightBarButtonItem,问题如下:
首次push到B页面后,rightBarButtonItem短暂出现,但是很快就消失不见了
再次进入后,可以正常显示。

無法返回

demo 上下滑動完後, 有時可以側滑返回,有時又不行,不知是否是bug

请问这里为什么要生成一个透明的configuration,这样会导致fakebar的frame有问题

   if (showFakeBar) {
        YPNavigationBarConfigurations transparentConf = YPNavigationBarConfigurationsDefault | YPNavigationBarBackgroundStyleTransparent;
        if (showConfigure.barStyle == UIBarStyleBlack) transparentConf |= YPNavigationBarStyleBlack;
        transparentConfigure = [[YPBarConfiguration alloc] initWithBarConfigurations:transparentConf
                                                                           tintColor:showConfigure.tintColor
                                                                     backgroundColor:nil
                                                                     backgroundImage:nil
                                                           backgroundImageIdentifier:nil];
    }

Swift 如何实现呀 感觉有点懵呢

  • (YPNavigationBarConfigurations) yp_navigtionBarConfiguration {
    YPNavigationBarConfigurations configurations = YPNavigationBarShow;
    if (_gradientProgress < 0.5) {
    configurations |= YPNavigationBarStyleBlack;
    }

    if (_gradientProgress == 1) {
    configurations |= YPNavigationBarBackgroundStyleOpaque;
    }

    configurations |= YPNavigationBarBackgroundStyleColor;
    return configurations;
    }

这段代码 如何转向Swift

例如 这:
YPNavigationBarConfigurations configurations = YPNavigationBarShow;
configurations |= YPNavigationBarStyleBlack;

并且Swift中 不调用 .show (YPNavigationBarShow) 这个枚举
谢谢

怎么能够动态控制 pop 手势?

你好,非常感谢你的开源资源,我很喜欢这个库。
因为业务需求,需求需要动态控制页面的 pop 手势,或者是在退出页面时进行一些操作,例如弹框提示用户是否保留数据之类;但看到库中把并没有暴露相关API,有时间的话,希望能解决这个问题呢,再次感谢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.