首页 技术 正文
技术 2022年11月11日
0 收藏 554 点赞 3,644 浏览 3832 个字

TabBarController 修改tabbar的背景颜色和选中时候的颜色:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch. application.registerUserNotificationSettings(UIUserNotificationSettings(
forTypes:UIUserNotificationType.Badge, categories: nil)) UIApplication.sharedApplication().cancelAllLocalNotifications() let localNotification = UILocalNotification()
localNotification.applicationIconBadgeNumber =
UIApplication.sharedApplication().scheduleLocalNotification(localNotification) UITabBar.appearance().tintColor = UIColor(red: 227.0/255.0, green: 28.0/255.0, blue: 31.0/255.0, alpha: )
UITabBar.appearance().barTintColor = UIColor(red: , green: , blue: , alpha: )
return true
}

文章链接:http://www.uisdc.com/xcode-tutorials-for-designer-4

设置 Tabbaritem 上的图章

class myTabBarController: UITabBarController, UITabBarControllerDelegate {    override func viewDidLoad() {
super.viewDidLoad() self.delegate = self NSLog("Number of view controllers: \(self.viewControllers?.count)") self.viewControllers![].tabBarItem.badgeValue = String()
self.viewControllers![].tabBarItem.badgeValue = "..."
self.viewControllers![].tabBarItem.badgeValue = "s"
self.viewControllers![].tabBarItem.badgeValue = "-"
//self.viewControllers![0].tabBarItem. // Do any additional setup after loading the view.
} override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
} /*
// MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/}

手工建立一个TabbarController: http://www.cnblogs.com/wendingding/p/3775488.html

Swift – 设置应用程序图标的提醒个数(右上角小红圈)

2015-07-22 10:20发布:hangge浏览:433

 使用UILocalNotification除了可以实现本地消息的推送功能(可以设置推送内容,推送时间,提示音),还可以设置应用程序右上角的提醒个数。

 下面演示如何设置,效果图如下:IOS 今天学到太多的知识了,赶快记录下来 — AppDelegate.swift —

123456789101112131415161718192021222324252627282930 import UIKit @UIApplicationMainclass AppDelegateUIResponderUIApplicationDelegate {     var window: UIWindow?     func application(application: UIApplication,        didFinishLaunchingWithOptions launchOptions: [NSObjectAnyObject]?) -> Bool {        application.registerUserNotificationSettings(UIUserNotificationSettings(            forTypes: UIUserNotificationType.Sound UIUserNotificationType.Alert |            UIUserNotificationType.Badge, categories: nil))        return true    }     func applicationWillResignActive(application: UIApplication) {    }     func applicationDidEnterBackground(application: UIApplication) {    }     func applicationWillEnterForeground(application: UIApplication) {    }     func applicationDidBecomeActive(application: UIApplication) {    }     func applicationWillTerminate(application: UIApplication) {    }}

— ViewController.swift —

123456789101112131415161718192021222324252627 import UIKit class ViewControllerUIViewController {         override func viewDidLoad() {        super.viewDidLoad()                 //发送通知消息        scheduleNotification();    }         //发送通知消息    func scheduleNotification(){        //清除所有本地推送        UIApplication.sharedApplication().cancelAllLocalNotifications()                 //创建UILocalNotification来进行本地消息通知        var localNotification = UILocalNotification()        //设置应用程序右上角的提醒个数        localNotification.applicationIconBadgeNumber = 78;        UIApplication.sharedApplication().scheduleLocalNotification(localNotification)    }         override func didReceiveMemoryWarning() {        super.didReceiveMemoryWarning()    }}

原文出自:www.hangge.com  转载请保留原文链接:http://www.hangge.com/blog/cache/detail_796.html

http://stackoverflow.com/questions/18924431/ios-7-navigationcontroller-is-setting-the-contentinset-and-contentoffset-of-m

文章有个回复说 UIViewController 会修改第一个子view的 contentInset,

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,117
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,589
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,435
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,206
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,842
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,927