Comments (6)
zx_navItemMargin
您好,我将demo运行至iOS 10.3的模拟器上未发现异常,如果方便的话,麻烦您提供一下您对ZXNavigationBar
的具体设置或提供一个demo来帮助我复现和解决此问题,感谢!!
from zxnavigationbar.
这个问题发生在:在基类控制器中设置了zx_navLeftBtn的大小,在次控制器中就会出这个问题。已复现。
这是基类代码:
-(void)viewDidLoad{
[super viewDidLoad];
self.view.backgroundColor = UIColor.whiteColor;
self.zx_navStatusBarStyle = ZXNavStatusBarStyleDefault;
self.zx_navTitleColor = UIColor.blackColor;
self.zx_navTitleFont = [UIFont systemFontOfSize:17 weight:UIFontWeightRegular];
self.zx_navLineView.hidden = YES;
if(self.navigationController.viewControllers.count>1){
UIImage* lefImg = [UIImage imageNamed:@"arrow_left"];
[self zx_setLeftBtnWithImg:lefImg clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self.navigationController popViewControllerAnimated:YES];
}];
self.zx_navLeftBtn.zx_fixWidth = 44;
self.zx_navLeftBtn.zx_fixHeight = 44;
self.zx_navLeftBtn.zx_fixImageSize = CGSizeMake(lefImg.size.width, lefImg.size.height);
//self.zx_navLeftBtn.backgroundColor = UIColor.orangeColor;
}
}
这是次控制器的代码
[self zx_setLeftBtnWithImg:[UIImage imageNamed:@"arrow_leftWhite"] clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self gotoBack];
}];
[self zx_setRightBtnWithText:@"活动规则" clickedBlock:^(ZXNavItemBtn * _Nonnull btn) {
[self activityRules];
}];
//self.zx_navItemMargin = 10;
from zxnavigationbar.
- 如果要更改返回按钮图片,只需要在基类控制器中设置:
self.zx_backBtnImageName=@"图片名称"
即可。 - 不需要配备不同颜色的返回图片,设置导航栏或
self.zx_leftBtn
的zx_tintColor
属性即可。 - 不建议您根据图片大小设置
self.zxleftBtn
的大小,这会导致当您在不同控制器的返回图片大小不一样的情况下,self.zxleftBtn
的大小也不一样。如果需要设置导航栏按钮的大小,可以通过
//设置指定导航栏按钮大小
self.zx_navLeftBtn.zx_fixWidth = 44;
self.zx_navLeftBtn.zx_fixHeight = 44;
或
//设置所有导航栏按钮大小
self.zx_navItemSize = 44;
进行设置。
- 在self的block中使用self会导致循环引用,请使用weakSelf。
from zxnavigationbar.
在iOS10.3的系统上(我用的真机),按照你的上面的建议这个问题依然存在。
只要在一个控制器中同时设置了self.zx_navLeftBtn.zx_fixWidth和右按钮,右按钮就存在这个问题。我在viewdidapper中打印了zx_navRightBtn的frame,发现它的宽度更新了,但x值没被更新。
我有时间也会帮忙查一下这个问题的根本原因。另外一个要注意的点是,如果我设值了zx_fixWidth,我必须更改imageView.contentMode从UIViewContentModeScaleToFill到UIViewContentModeCenter,才能使图片不变形,这个跟图片大小有关,不是代码问题,只是一个使用者需要注意的点。
from zxnavigationbar.
您好,我使用本项目的demo未能复现。ZXNavigationBar
最新版本为1.3.1,如果您不是最新版本,请更新到最新版本试一下哈。若问题依然存在,可以录个视频或提供一个demo帮助我复现和解决此问题。您也可以下载此项目的demo运行才10.3上测试一下。
from zxnavigationbar.
很抱歉,准确的说是10.3.3系统。1.3.1也存在。以下是一些表现 https://www.jianshu.com/p/746536b72fdf
from zxnavigationbar.
Related Issues (20)
- 如何增大backButton的触发面积. HOT 1
- 我想在当前页面禁止pop手势,或者是拦截返回手势,设置以下无效, HOT 2
- 提个建议 HOT 1
- BackButtonHandlerProtocol 协议名重复 HOT 1
- 设置状态栏颜色不管事怎么解决 HOT 9
- TableViewController的显示有问题。 HOT 2
- 请问侧滑返回能增加像系统导航那种渐变吗 HOT 1
- TableViewController还是有比较严重的问题 HOT 2
- 能不能ZXNavigationBarController加个分类,就是不继承它,也可以使用相关的属性 HOT 1
- safeArea布局问题
- zx_setPopGestureCompatibleScrollView返回手势冲突解决问题 HOT 3
- 如果viewcontroller里面并排两个tableview,第二个tableview就会到导航栏下面去了 HOT 1
- 可以适配RTL吗
- self.zx_navBar.zx_y = 200;发现无法改变zx_navBar的位置
- 好像对TableViewController失效了 HOT 3
- 写的很好哦 HOT 1
- 请问现在有适配iOS 15了么?
- 麻烦适配下iOS 13的一些属性获取,比如keyWindow,statusBarFrame这些 HOT 1
- IQKeyboardManager冲突 HOT 1
- It looks very convenient, but I don't know how to use it HOT 1
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 zxnavigationbar.