
UINavigationController 导航控制器
小手一背爱谁谁
这个作者很懒,什么都没留下…
展开
-
iOS UIImagePickerController 自定义导航条背景、标题和按钮的颜色
UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; // 左右按钮颜色 [[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]] ; // 标题颜色 NSMutableDictionary *attrs = [NSMutableDictionary dict...原创 2021-07-21 15:08:26 · 1072 阅读 · 0 评论 -
iOS 横屏启动时页面错乱解决方案
在控制器调用恢复状态栏事件#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self restoreStatusBarOrientation];}原创 2020-12-04 16:22:39 · 1150 阅读 · 0 评论 -
iOS 如何完整复制另一个视图控制器的内容
// 如果需要导航控制器 NavgationController 则需要继承父类(如父类没有导航控制器 或者不需要请忽略本)// 将另一个视图控制器的页面添加到当前页面 - (void)addView { ListViewController *chatViewController = [[ListViewController alloc] initWithNibName:@...原创 2017-01-11 15:44:53 · 2359 阅读 · 0 评论 -
iOS 控制器跳转时打开关闭页面动画
typedefenum : NSUInteger { Fade = 1, //淡入淡出 Push, //推挤 Reveal, //揭开 MoveIn, //覆盖原创 2017-01-16 13:31:16 · 702 阅读 · 0 评论 -
iOS 解决视图往下偏移的问题
- (void)viewDidLoad { [superviewDidLoad]; //以下两行代码根据需要设置 self.edgesForExtendedLayout = YES; self.automaticallyAdjustsScrollViewInsets=YES; // 设置CGRectZero从导航栏下开始计算 ...原创 2016-10-15 18:30:31 · 6469 阅读 · 0 评论 -
iOS 控制器跳转动画
/** 控制器跳转动画 */+(void)tiaoZhuanDongHua:(NSString *)type { CATransition *animation = [CATransitionanimation]; //设置运动轨迹的速度 animation.timingFunction =UIViewAnimationCurveEa原创 2017-03-22 14:31:50 · 342 阅读 · 0 评论 -
iOS 加载xib页面顶部被遮挡问题
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. // 方法一 if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:...原创 2017-03-16 11:09:57 · 1911 阅读 · 1 评论 -
iOS 导航条透明(以及自定义颜色)的方法,去掉导航条底部黑线,随着tableView滚动设置导航条变色
#import #define NAVBAR_CHANGE_POINT30@interface UINavigationBar (Awesome)- (void)lt_setBackgroundColor:(UIColor *)backgroundColor;- (void)lt_setElementsAlpha:(CGFloat)alpha;- (原创 2017-03-17 13:02:06 · 1841 阅读 · 0 评论 -
iOS tableView头部拉伸并改变导航条渐变色
#import "TableViewController.h"static NSString *ident =@"cell";#define RGBA(r,g,b,a) [UIColor colorWithRed:r/255.0f green:g/255.0f blue:b/255.0f alpha:a]#define RGB(r,g,b) RG原创 2018-05-05 17:24:30 · 894 阅读 · 0 评论 -
iOS 拦截导航栏返回按钮事件(只拦截点击事件不改变系统按钮样式)
#import <UIKit/UIKit.h>@protocol BackButtonHandlerProtocol <NSObject>@optional/** 重写下面的方法以拦截导航栏返回按钮点击事件,返回 YES 则 pop,NO 则不 pop @return <#return value description#> */-(BOO...原创 2018-11-14 09:46:07 · 4184 阅读 · 0 评论 -
iOS 页面跳转后去掉返回按钮和返回手势
//去掉返回按钮 self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@""style:(UIBarButtonItemStyleDone)target:selfaction:nil];// 去掉返回手势if ([self.navigationCo原创 2016-12-21 16:51:19 · 2464 阅读 · 0 评论 -
iOS 去掉UINavigationController(导航控制器)去除底部黑线、改背景颜色或者改为全透明
- (void)viewWillAppear:(BOOL)animated {// 改背景图 [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"0031"] forBarMetrics:(UIBarMetricsDefault)];// 去掉导航条底部黑线原创 2016-06-02 12:00:38 · 4630 阅读 · 0 评论 -
iOS 隐藏导航控制器返回按钮
[self.navigationItem setHidesBackButton:YES];//让返回按钮不显示原创 2016-05-10 14:04:31 · 1329 阅读 · 0 评论 -
iOS 自定义分区头加上图片 以及导航控制器 颜色随滑动改变
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ if(section==0) { return 200; } return 15;}-(UIView*)tableView:(UITableView *原创 2016-06-01 14:28:44 · 1265 阅读 · 0 评论 -
iOS UINavigationController代理方法实现自定义
self.navigationController.delegate = self;- (void) navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animat原创 2016-06-02 14:56:12 · 2080 阅读 · 0 评论 -
iOS UINavigationController修改导航栏标题、按钮文字以及背景的颜色
//方法一- (void)setNav { // 导航栏背景颜色 [self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.000 green:0.800blue:0.800 alpha:1.000]]; // 导航栏标题字体颜色 [self.na...原创 2016-08-19 14:02:39 · 14765 阅读 · 1 评论 -
iOS UINavigationController 自定义设置
self.navigationController.navigationBar.translucent = NO;//半透明self.automaticallyAdjustsScrollViewInsets =NO;//取消导航栏自动适应self.edgesForExtendedLayout =UIRectEdgeNone;// 设置vi原创 2016-10-20 15:56:31 · 1230 阅读 · 0 评论 -
iOS UINavigationController 修改导航条背景
[self.navigationController.navigationBarsetBarTintColor:[UIColorwhiteColor]];原创 2016-10-20 11:48:43 · 430 阅读 · 0 评论 -
ios 弹出键盘 顶端navigationbar 会上移
是因为使用了IQKeyBoardManager 问题加上这段代码解决-(void)loadView { UIScrollView *scView = [[UIScrollView alloc]initWithFrame:[UIScreen mainScreen].bounds]; self.view = scView;}原创 2016-02-02 15:40:06 · 4837 阅读 · 3 评论 -
iOS UINavigationController导航条背景透明
//方法一- (void)setCleanNavtion { //自定义背景 [self.navigationController.navigationBarsetBackgroundImage:[UIImagenew] forBarMetrics:UIBarMetricsDefault]; //消除阴影 self.navigationContr...原创 2016-10-19 15:40:05 · 4847 阅读 · 0 评论 -
iOS添加左右导航按钮
UIBarButtonItem *button =[[UIBarButtonItem alloc]initWithTitle:@"返回" style:UIBarButtonItemStyleDone target:self action:@selector(closeConversation)]; self.navigationItem.rightBarButtonItem = butt原创 2016-01-28 12:28:40 · 1885 阅读 · 0 评论