uitabbarcontroller

Odd behavior from UITabBar where background color only shows for one tab

不羁的心 提交于 2020-03-26 21:53:12
问题 I am using Swift 3 and I researched various methods to set the backgroundColor color of a UITabBar . The most simple method was to change the property in the didFinishLaunchingWithOptions of the AppDelegate . When I tried to do this, the UITabBar launches with the standard color, which is not my intended result. However, when I go to the next tab, the UITabBar color gets changed to my intended color. Following this, I tried to subclass my UITabBarController and I tried to set the background

iOS开发项目篇-01环境搭建

扶醉桌前 提交于 2020-02-13 04:52:31
iOS开发项目篇-01环境搭建 一、基本过程 1.新建一个项目 (1)删除storyboard    (2)在配置界面中,把main 删除,手动设置 2.准备素材 图片素材如下:    这个项目是模仿新浪,实现一个山寨的新浪微博系统,新版本的系统中已经放弃了非视网膜屏幕。 说白了,这种情况下,如果手机是3.5英寸的ios7系统,则看不到该启动动画。 设置方法,右键单击show in finder,修改json文件。 Contents.json,对文件进行修改,让系统启动画面对3.5英寸的ios7系统提供支持。 完成后,在项目中的显示如下: 模拟器上应用程序图标: 二、简单代码 1 // 2 // YYAppDelegate.m 3 // 01-微博环境搭建 4 // 5 // Created by apple on 14-7-3. 6 // Copyright (c) 2014年 itcase. All rights reserved. 7 // 8 9 #import "YYAppDelegate.h" 10 11 @implementation YYAppDelegate 12 13 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *

size of the tabBarItems in a UITabBarController

只谈情不闲聊 提交于 2020-02-07 04:08:06
问题 I have 4 tabs in my APP for iPad . The problem is that sometimes the text is bigger than the button but i have more space to use. However, the UITabBarController doesn't use all the width for the tabBarItems . Is there an option to do it? 回答1: UITabBarController will automatically insert spaces in between. You could do two things Override UITabButton's sizeThatFits method to give it your own size Insert negative-width spaces in between For option 2, here's some sample code I used for toolbars

How do I hid the UITabBarView when loading some view?

放肆的年华 提交于 2020-02-05 15:49:08
问题 I'm developing an iPhone app, where I have a UITabBarController that has a UINavigationController for each TabBarItem. I want, after some level of navigation, to hide the TabBar, and to replace it with a full screen view, just like the iPod application, the TabBar hides when you reach the media player, and returns when you get back to the playlist or whatever. Any help or thoughts is highly appreciated 回答1: Set the new viewController's hidesBottomBarWhenPushed: -property. That will hide the

TabBarController adding custom button not clickable issue [duplicate]

亡梦爱人 提交于 2020-02-01 06:57:08
问题 This question already has answers here : Make custom button on Tab Bar rounded (4 answers) Closed 2 years ago . I'm adding a custom button over the tabBarController and the button becomes over the tabBarController it is clicked when I hit it inside the tabBarController it is working fine but if I hit the part outside the tabar it is not clickable. class CustomBar: UITabBarController, UITabBarControllerDelegate { func addButton() { mainBasketView.frame = CGRect(x: self.view.frame.size.width /

TabBarController adding custom button not clickable issue [duplicate]

…衆ロ難τιáo~ 提交于 2020-02-01 06:56:45
问题 This question already has answers here : Make custom button on Tab Bar rounded (4 answers) Closed 2 years ago . I'm adding a custom button over the tabBarController and the button becomes over the tabBarController it is clicked when I hit it inside the tabBarController it is working fine but if I hit the part outside the tabar it is not clickable. class CustomBar: UITabBarController, UITabBarControllerDelegate { func addButton() { mainBasketView.frame = CGRect(x: self.view.frame.size.width /

TabBarController adding custom button not clickable issue [duplicate]

纵然是瞬间 提交于 2020-02-01 06:55:12
问题 This question already has answers here : Make custom button on Tab Bar rounded (4 answers) Closed 2 years ago . I'm adding a custom button over the tabBarController and the button becomes over the tabBarController it is clicked when I hit it inside the tabBarController it is working fine but if I hit the part outside the tabar it is not clickable. class CustomBar: UITabBarController, UITabBarControllerDelegate { func addButton() { mainBasketView.frame = CGRect(x: self.view.frame.size.width /

Change default global tint color in swift

℡╲_俬逩灬. 提交于 2020-01-31 04:49:08
问题 I'm developing a little app and I would like to change the default global tint color from blue to orange. I've seen many ways to do it in Objective-C but I can't seem to get it to work using swift. How could I achieve this? Thanks in advance! 回答1: Couldn't that be easier? @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool { self.window

How to switch between UITabBarController programmatically

这一生的挚爱 提交于 2020-01-25 09:04:21
问题 I have an application with UITabBarController, where the first tab contains a ViewController of an HomePage. What I have to do, is to switch between the tabs (this is pretty simple: [[self tabBarController] setSelectedIndex:index]), AND to navigate through outlets of the selectedTab from the "HomePage". Just to explain myself: TabElement1--->TabElementX---->UISegmentedController:segmentY The problem is that the UISegmentedController is nil because it is not initialized yet (at least the first

Unable to see controller added to UITabBar programmatically swift

谁都会走 提交于 2020-01-24 22:55:11
问题 I added 2 tabBar items from storyboard and one UITabBarItem - Menu programmatically. I am successfully able to open the controllers corresponding to tabBarItems which I created using storyboard. However, when I click on "Menu" a blank black screen appears, @objc public class MainScreenTabsController : UITabBarController { public override func viewDidLoad() { super.viewDidLoad() let tabController = MyViewController() let tabBarItem = UITabBarItem(title: "Menu", image: UIImage(named: "more