Comments (17)
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
[self changeOrignalSEL:@selector(sizeThatFits:) swizzleSEL:@selector(ddy_SizeThatFits:)];
[self changeOrignalSEL:@selector(layoutSubviews) swizzleSEL:@selector(ddy_LayoutSubviews)];
});
}
+ (void)changeOrignalSEL:(SEL)orignalSEL swizzleSEL:(SEL)swizzleSEL {
Method originalMethod = class_getInstanceMethod([self class], orignalSEL);
Method swizzleMethod = class_getInstanceMethod([self class], swizzleSEL);
if (class_addMethod([self class], orignalSEL, method_getImplementation(swizzleMethod), method_getTypeEncoding(swizzleMethod))) {
class_replaceMethod([self class], swizzleSEL, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
} else {
method_exchangeImplementations(originalMethod, swizzleMethod);
}
}
- (CGSize)ddy_SizeThatFits:(CGSize)size {
CGSize navigationBarSize = [self ddy_SizeThatFits:size];
if (@available(iOS 11, *)) {
navigationBarSize.height = navigationBarSize.height + [[UIApplication sharedApplication] statusBarFrame].size.height;
}
return navigationBarSize;
}
- (void)ddy_LayoutSubviews {
[self ddy_LayoutSubviews];
if (@available(iOS 11, *)) {
for (UIView *aView in self.subviews) {
if ([@[@"_UINavigationBarBackground", @"_UIBarBackground"] containsObject:NSStringFromClass([aView class])]) {
aView.frame = CGRectMake(0, -CGRectGetMinY(self.frame), CGRectGetWidth(self.frame), CGRectGetHeight(self.frame)+CGRectGetMinY(self.frame));
}
}
}
}
from cwlateralslide.
如果地图打开,然后跳转到抽屉页面,页面会整体向下偏移40,如果偏移的40恢复原状时,缩放的抽屉会出现bug
from cwlateralslide.
这个是苹果系统iOS11的问题。。https://juejin.im/post/5a6bf18ff265da3e5859947f 这个文章的第4大点有解决方案,同时我把解决方法同步到了demo内,可以参考一下。
from cwlateralslide.
非常感谢,用的方法二,很有用
from cwlateralslide.
😁OK
from cwlateralslide.
请问一下,我从左边的页面push到下一页,然后pop回来,显示的是主页面,左边的页面收回去了,这样子,用户使用起来,很不方便,请问有没有办法,在pop回来之后,左边的页面仍然保留存在,不消失,就是pop回来显示的不是主界面,而是拉出来的左界面?
from cwlateralslide.
#54 看看这个能不能满足哦
from cwlateralslide.
from cwlateralslide.
麻烦描述清楚一点哦,什么bug?来个gif图吧。 用LICEcap可以录gif图
from cwlateralslide.
无论是设置背景图或者直接修改_UIBarBackground位置信息都并没有从根本上解决问题,如果碰到其他scale可能这两个方法都无能为力了。所以如果去根治本需要从两方面着手,1,更改导航高度(和iOS11一下一致,如普通机型64高度,iPhoneX特例88),然后布局子视图时更改 _UINavigationBarBackground和_UIBarBackground位置信息。
from cwlateralslide.
@starainDou 可以先看一下上面链接的文章哦,你所说的去根治本的两方面,文章说得比较详细,demo里面也写了重新布局的方式。至于设置背景图可以解决上面这个问题,因为这种方式比较简单,对项目影响较少,也不一定说没有治根,因为这是苹果的问题,比如苹果可能会写 有背景图的情况下是正常的布局,没有背景图的情况下是异常的布局,于是你设置背景图就正好走的是正常的布局分支,刚好避免了去走异常布局的分支,这个也说不定的,所以再没发现其他问题的情况下,我还是建议设置背景图来得方便。
from cwlateralslide.
你这个方式应该也可以。其实都是一个意思,最终把布局纠正对就好了,但是解决的方式来说,你这种交换方法这种应该是最合适的
from cwlateralslide.
点击北京灰色view返回时,collectionView会整体向下移动,有时候还会导致崩溃
from cwlateralslide.
@GitForTSir 向下偏移,设置这个 self.edgesForExtendedLayout = UIRectEdgeNone; 或者看看是不是iOS 11 安全区域适配的问题。崩溃的问题贴一下崩溃错误是啥。
from cwlateralslide.
手势冲突 导致无法左滑右滑
from cwlateralslide.
你好 请问这代码放在哪个地方?? @starainDou
from cwlateralslide.
我放在了UINavigationBar分类里 还是没解决我的问题 @starainDou
from cwlateralslide.
Related Issues (20)
- iOS13,调用抽屉效果后返回,无论哪一层都会回到首页。 HOT 3
- 抽屉页面下隐藏tabbar无效? HOT 1
- 隐藏navigationbar导致侧滑白屏
- dismiss异常问题,设置rootViewController的ModalTransitionStyle可以解决 HOT 2
- CWLateralSlide和RTRootNavigationController结合使用的问题 HOT 3
- cw_pushViewController 不能显示下一个控制器导航栏 HOT 3
- 设置maskAlpha为0不管用 HOT 2
- 在三级控制器调用系统摄像头dismiss后回首页黑屏
- [self dismissViewControllerAnimated:YES completion:nil]; iOS13返回白屏
- 抽屉式做筛选功能的,dismiss之后页面没有之前的状态了 HOT 3
- 多个控制器都有侧滑窗口的时候cw_push会有问题
- 横竖屏问题
- 模态出来的vc,打开侧滑抽屉时,vc会上移至顶部
- 强制实现push到下一个controller返回后能保持抽屉打开状态以后产生的问题
- Unbalanced calls to begin/end appearance transitions for < mainViewController: 0x12f510530>
- 请问为什么 dissmiss 的时候 会闪烁一下呢?
- 返回白屏
- cw_pushViewController到一个控制器直接白屏
- 关于蒙版的优化 HOT 1
- 苹果新政策要求添加隐私清单PrivacyManifest,麻烦支持一下 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cwlateralslide.