secButton.setTitle("已评价", forState: UIControlState.Disabled); secButton.enabled = false; UINavigationBar(全局设置) Swift...示例 let appear = UINavigationBar.appearance(); //设置Item的样式 appear.tintColor = UIColor.whiteColor(); //...: UIFont.systemFontOfSize(18)]; OC示例 UINavigationBar *appear = [UINavigationBar appearance]; appear.tintColor...NSForegroundColorAttributeName]; //大功告成 self.navigationController.navigationBar.titleTextAttributes = dict; 设置透明(Swift...全局设置) Swift示例 let searchBarAppear = UISearchBar.appearance(); //searchBarAppear.translucent = false;
以下是一个具体实例: let bg = TVButtonLayer(image: UIImage(named: "TVBG.png")!)...let top = TVButtonLayer(image: UIImage(named: "TVbtnTop.png")!)...tvButton.layers = [background, pattern, top] 然后,您可以通过更改以下属性来自定义视差效果强度: tvButton.parallaxIntensity =...TKRubberIndicator TKRubberIndicator是Swift制作的库,它可在应用程序中添加橡胶动画页面控件。要使用它,您需要首先导入TKRubberPageControl框架。...sizePickerView.pickerFieldConfigureBlock = { field in field.text = "m" } sizePickerView.tintColor
imagePicker.imagePickerDelegate = self; imagePicker.filterType = DNImagePickerFilterType.Photos; imagePicker.navigationBar.tintColor...") let image1 = UIImage(named: "icon_file_menu_folder") let image2 = UIImage(named: "icon_file_menu_img...") let image3 = UIImage(named: "icon_file_menu_movie") let images:[UIImage] = [image1!...String } 数据请求 Swift数据请求常用的三个库 Alamofire 网络请求库 Swift SwiftyJSON 转JSON Swift Alamofire-SwiftyJSON 方便以上两个组件的结合使用...Swift
UIBarMetricsLandscapePhone功效一样,不过iOS8已经弃用了 UIBarMetricsCompact, UIBarMetricsDefaultPrompt和UIBarMetricsCompactPrompt 更改顶部状态栏的颜色...use on dark backgrounds 这个一个是默认的,黑色颜色,用于亮色背景,一个是白色用于深色背景 设置返回按钮 有时候我们会发现,我们设置的返回按钮都是蓝色的默认颜色,那么到底该怎么更改这些按钮的颜色呢...设置返回按钮的颜色,只设置tintColor的颜色就好了 self.navigationController.navigationBar.tintColor = [UIColor whiteColor...tintColor的颜色(默认为蓝色)。...首先,我做了个UIImage的分类:通过颜色转成UIImage; 然后,用上面的方案来设置导航栏底部线条。
设置搜索框 // 搜索框 let bar = searchController.searchBar // 样式 bar.barStyle = .default // 设置光标及取消按钮的颜色 bar.tintColor...设置光标及取消按钮的颜色 去除背景 // 去除背景及上下两条横线 bar.setBackgroundImage(UIImage(), for: .any, barMetrics: .default) ?...0.96, a: 1.00) searchBar.barTintColor = commonBgColor // 搜索框 searchBar.barStyle = .default searchBar.tintColor...VoiceSearchStartBtn"), for: .bookmark, state: .normal) extension UIColor { func trans2Image() -> UIImage...UIImage() } } 附上相关项目:Swift 3.0 高仿微信
前言 总结下 swift下的基础语法,里面涉及到:常量&变量、Swift中的数据类型、逻辑分支、循环、字符串相关、数组和字典、方法的书写调用等内容,考虑到阅读体验分多篇来展示,希望对大家学习swift...Swift| 基础语法(一) Swift| 基础语法(二) Swift| 基础语法(三) Swift| 基础语法(四) Swift| 基础语法(五) 本文涉及: 纯代码创建应用根试图 UILabel...UITabBarItem.appearance().titlePositionAdjustment = UIOffsetMake(0.0, -5.0) // 设置图标选中时颜色 UITabBar.appearance().tintColor...return tabbarController } 这里特别说明下:默认未选中标签的图片和文字是灰色的,选中的是蓝色的,下面修改成橙色: //图片文字一起变色 self.tabBar.tintColor...UIImage imageV?.
appear = UINavigationBar.appearance(); appear.isTranslucent = false; //设置Item的样式 appear.tintColor...appear.backgroundColor = ZJColor.mainColor; //去掉navigationBar下的黑线 appear.setBackgroundImage(UIImage...(), for: UIBarMetrics.default) appear.shadowImage = UIImage(); //设置标题样式 appear.titleTextAttributes...]; let tabbarAppear = UITabBar.appearance(); tabbarAppear.tintColor = ZJColor.mainColor;...找到Objective-C Bridging Header 设置值为$(SWIFT_MODULE_NAME)/Bridge-Header.h 设置状态栏颜色 项目的Info.plist添加配置View
下面是swift书写的时候的两个方法,其实这里不是教大家怎么样写的这个问题,我是想通过这两个不同语言的进行的一个比较,向大家找他们之间“想法”上的一些相同点,这样子我们学习swift的时候,就可以更加的游刃有余...我们熟悉OC这门语言,找到他么想法上的相同点了,你也就可以利用OC来学习swift了。...private func addChildViewControllers() { tabBar.tintColor = UIColor.orangeColor()...title: String, imageName: String) { vc.title = title vc.tabBarItem.image = UIImage
无法更改表 有时,在修改创建的表中内容时,会弹出如图所示的警告弹窗,解决方法如下 在数据库工具栏选择选项 在设计器中,选择表设计器和数据库设计器,将阻止保存要求重新创建表的更改选项取消勾选
navView.userInteractionEnabled = YES;// 需要处理点击事件 navView.image = [UIImage..._tableView.bounces = NO; } else { _tableView.bounces = YES; } } II 更改...类型的,比如修改系统导航栏的barButtonItem,直接设置tintColor即可。...vc.navigationItem.leftBarButtonItem.tintColor = [UIColor whiteColor]; 但是修改自定义按钮的tintColor,需要设置图片的渲染模式为...; UIImage *img = [[UIImage imageNamed:QCTNAVicon_left] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate
self.navigationBar.barTintColor = UIColor.brownColor() UINavigationBar.appearance().tintColor...image = UIImage(named: "定位.png") self.addSubview(logoImgView!)...image = UIImage(named: "你自己弄") cell?.buildLabel?....学了这么几天,我发现Swift还是比较容易入手的,下篇文章我会用一个小的项目,本人是做室内地图SDK的,这次的小项目是仿我OC写的SDK Demo,使用Swift和OC混编,集成百度地图SDK和自己的室内...在下篇文章中会讲讲,Swift项目已上github:https://github.com/qingmomo/Swift-die OC版的demo在我们官网:http://www.innsmap.com
第一种使用Core Image进行模糊 - (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur...imageWithCGImage:outImage]; } 第二种使用vImage API进行模糊 - (UIImage *)blurryImage:(UIImage *)image withBlurLevel...*)imageBluredWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat..., effectImage.CGImage); CGContextRestoreGState(outputContext); } // 添加颜色渲染 if (tintColor...{ CGContextSaveGState(outputContext); CGContextSetFillColorWithColor(outputContext, tintColor.CGColor
swift组件化 看了很多关于iOS组件化的文章,觉得光是看不写不足以很好的理解组件化,所以就自己写了一个demo以组件化构建。...ZQKit这是自定义的一个framework,是一些UIKit的扩展,但是此demo我只放一个UIImage的扩展。 ZQMediator自定义的组件中间协调者,具有一个单例。...从第二模块push一个蓝色的控制器,并且传递一个字符串,这蓝色的控制器是在第一模块中创建的, Demo代码释义 1、AppDelegate.swift 在APPDelegate注册路由跳转scheme为...debugPrint("not found controller string") return true } //在swift...fileprivate func configChildViewControlelrs() { self.tabBar.tintColor = UIColor.orange if let
按照以前我使用font-face的方式,设计只需要传一套,我这边改颜色,既然很多大佬(比如:张鑫旭)都说SVG Sprites比font-face高几层楼,那肯定也支持颜色更改吧。...这不我就刷到了张大佬的svg图标更改颜色,讲得通俗易懂,十分全面。 外部交涉 我试了所有方式,都没成功。好家伙,时间紧,任务重。也就不想纠结原因了,然后就想着找设计要两套吧。...对比两个图标的path 原因 所以还是svg生成的时候设置了fill属性,导致无法更改颜色。修改方法,需要设计那边上传单色图标。
CGContextSetFillColor(context, CGColorGetComponents( [color CGColor])); // CGContextFillRect(context, rect); // self.tintColor...UIColor *color = [UIColor colorWithRed:46.0f/255.0f green:87.0f/255.0f blue:29.0f/255.0f alpha:1.0f]; UIImage...*img = [UIImage imageNamed: @"bg.png"]; [img drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height...)]; self.tintColor = color; } @end 图示: ?
Swift 接着就是源码了 1....thumbnailView.layer.shadowRadius = 10 thumbnailView.layer.shadowOpacity = 0.3 thumbnailView.image = UIImage...CustomPlayerCircularButtonView { nextButton.backgroundColor = .white nextButton.tintColor....zero) backgroundColor = .white.withAlphaComponent(0.5) layer.cornerRadius = height / 2 tintColor...= .black setImage( UIImage(systemName: symbolName)?
常见问题 1、 BarButtonItem 隐藏失效的解决方案:使用initWithCustomView进行实例化BarButtonItem 2、 iOS13.5.1 版本无法点击导航条右侧按钮:CustomView...无法点击代码 // UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; // [btn setTitle:QCTLocal...action:@selector(printBtn:) forControlEvents:UIControlEventTouchUpInside]; // btn.tag = 0; // btn.tintColor...// UIBarButtonItem *rightBtn = [[UIBarButtonItem alloc] initWithCustomView:btn]; // rightBtn.tintColor...*aimage = [UIImage imageNamed:@"icon_right_menu"]; UIImage *image = [aimage imageWithRenderingMode
UIImage( systemNamed: "doc.text" ) 那我们如果为了兼容只能使用图片来替代了。...图片颜色应该和文字、tintColor一致 c....图片应该缩放到和正常的Symbol图标一致或接近 a 是比较好解决的,主要使用 contentMode 属性 b 需要同时设置RenderingMode 以及 tintColor c 就比较麻烦了,最初的思路是设置...contentMode = .scaleAspectFit self.setImage( icon, for: .normal) self.tintColor = self.currentTitleColor...} } extension UIImage{ // 获取SF图标 早期系统使用图片资源 static func SFIcon( name:String ) -> UIImage
设置返回按钮 //只设置颜色 self.navigationController.navigationBar.tintColor = [UIColor orangeColor]; 复制代码 //设置成图片...UIImage *leftButtonImage = [[UIImage imageNamed:@"image"] imageWithRenderingMode...new]]; 复制代码 另外可以通过颜色转图片来修改导航条底部分隔线颜色 //动态地改变UIColor的alpha属性可以返回,不同alpha的图片;可用于动态改变导航条的透明度 + (UIImage...setTintColor:[UIColor whiteColor]]; } //也可以设置成图片 [[UINavigationBar appearance] setBackgroundImage:[UIImage...UIControlStateNormal]; [leftButton setTitle:@"返回" forState:UIControlStateNormal]; leftButton.tintColor
Swift-MVVM 简单演练(二) Swift-MVVM 简单演练(三) Swift-MVVM 简单演练(四) 前言 最近在学习swift和MVVM架构模式,目的只是将自己的学习笔记记录下来,方便自己日后查找...,这个元素的访问权限为文件内私有 - 过去的`private`相当于现在的`fileprivate` - 现在的`private`是真正的私有,离开了这个类或者结构体的作用域外面就无法访问了...= UIImage(named: "tabbar_" + imageName + "_selected")?....设置 navigationBar 的 title 的颜色 navigationBar.tintColor = UIColor.red这样是不对的,因为tintColor不是设置标题颜色的。.../* `Int`类型,在`64`位的机器是`64`位,在`32`位的机器是`32`位 如果不写明`Int 64`在 iPad 2 / iPhone 5/5c/4s/4 都无法正常运行
领取专属 10元无门槛券
手把手带您无忧上云