swift - 导航设置总结加深记忆
一.创建导航
let VC=ViewController()
let navigationC = UINavigationController(rootViewController: VC)
self.window?.rootViewController=navigationC
self.window?.backgroundColor=UIColor.white
二.导航栏标题颜色
self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor:UIColor.white];
三.导航条颜色
self.navigationController?.navigationBar.barTintColor = UIColor.white;
四.设置导航左右点击按钮
右:
let rightButton = UIButton(type: UIButtonType.custom)
rightButton.frame = CGRect(x: 0, y: 0, width: 33, height: 32)
rightButton.addTarget(self,action:#selector(ViewController.buttonAtion),for:UIControlEvents.touchUpInside)
rightButton.setTitle("123", for: UIControlState.normal)
let rightItem = UIBarButtonItem(customView: rightButton)
self.navigationItem.rightBarButtonItem = rightItem
点击事件:
@objc func buttonAtion(button:UIButton){
print("22按钮点击了")
}
swift - 导航设置总结加深记忆的更多相关文章
- UE4 Navmesh 室内导航设置
我用的UE版本是4.14.1 系统:win10 64 前不久给样板房里面做了一个扫地机器人,导航设置让我头大了很久,度娘也没有用,最后在谷哥上有所感悟,现在给出本人的设置过程和解决方案. 一开始拖 ...
- Swift 导航栏设置图片点击事件,图片蓝色的解决方案
如果导航栏想做一个点击事件,正好是一个图片 我们可以直接这样: self.navigationItem.rightBarButtonItem = UIBarButtonItem(image: UIIm ...
- Swift 导航栏设置
let width = UIScreen.mainScreen().bounds.size.width let height = UIScreen.mainScreen().bounds.size.h ...
- Swift 圆角设置
故事面板中设置圆角(storyboard) Key Path layer.borderWidth(边框宽度) layer.cornerRadius(圆角弧度) layer.borderColor(边框 ...
- swift导航栏导航按钮添加多个按钮事件
//导航左边返回按钮 let button1 = UIButton(frame:CGRectMake(0, 0, 18, 18)) button1.setImage(Constant.Image.Na ...
- dede导航设置成单页面内容
有时顶级导航可能就是一个单页面 如公司简介 联系我们等 方法一:直接在导航栏填写内容 常规设置 二高级选项设置模板 三 填写页面内容 四 模板页面调用 内容 可在栏目模板中用{dede:field.c ...
- Swift - 导航条(UINavigationBar)的使用
与导航控制器(UINavigationController)同时实现导航条和页面切换功能不同. 导航条(UINavgationBar)可以单独使用,添加至任何的UIView中.UINavigation ...
- ros机器人导航设置原点,目标点
之前利用movebase导航定位都是通过rviz用鼠标指来指去,实验时非常方便,但实际应用总不能也人工指来指去吧,这怎么体现智能呢 启动导航后,用以前使用的rviz设设置目标点来获取map坐标系下的位 ...
- 重新温习,不但可以让自己对js更加的深刻认识,又能加深记忆,至此每天一次复习记录在此。
Undefined类型,它只有一个值就是它本身,打个比方你在声明变量的时候又未对变量赋值也就是相关初始化操作,那么此刻该变量的值便是Undefined. var a//声明一个变量. console. ...
随机推荐
- vue-webpack项目本地开发环境设置代理解决跨域问题
前言: 一般跨域问题只要后端配置好的话,是不需要前端做处理的,但也不能保证你遇到的所有后端都能很好的处理这个问题,这个时候可能就需要前端设置代理解决这个问题了. 配置方法: 1. config/ind ...
- Instrumentation类——Android自动化测试学习历程
这里需要把Instrumentation类的视频的上.中.下三集一起看,把内容总结一下... 视频地址: http://study.163.com/course/courseLearn.htm?cou ...
- 【jquery】checkbox
jquery操作checkbox 模拟选中: $('#aaa').prop('checked', true); 模拟取消选中: $('#aaa').prop('checked', false); 其它 ...
- POJ 1177 Picture(线段树周长并)
描述 A number of rectangular posters, photographs and other pictures of the same shape are pasted on ...
- textarea 自动到右边就换行
java 到最右边的时候自动换行如实例: textArea.setLineWrap(true);
- shell中颜色的设置
linux启动后环境变量加载的顺序为:etc/profile → /etc/profile.d/*.sh → ~/.bash_profile → ~/.bashrc → [/etc/bashrc] 想 ...
- android 开发概述以及相关背景知识
参考链接:http://www.runoob.com/android/android-architecture.html http://www.runoob.com/android/android-a ...
- ubuntu远程桌面、VNC(转载)
VNC 远程桌面 配置/使用 for xfce 本贴主要目的为说明如何在windows系统下远程控制xfce桌面 Ubuntu 的默认GNOME桌面可以在系统设置中直接打开远程桌面,然后用Window ...
- vue2.0生命周期详解
首先上图展 <template> <div id="home"> <p>{{ message }}</p> </div> ...
- webstorm打开一个门户工程流程
1.电脑上安装了nginx ,进入conf目录下,找到nginx.conf打开 2.将原配置中server部分替换掉 server{ listen 80; server_nam ...