uitabbarcontroller

Bottom half of UITabbar is not responding to clicks

有些话、适合烂在心里 提交于 2019-12-23 04:36:44
问题 I have created a UITabbar with 3 items and placed it on a UIScrollView When I click the buttons of the tabbar they do not respond in the bottom half. The upper area is working fine. When clicking in the area just above the tabbar the tabs are also switched. What can be wrong? How can i correct this misalignment of the clickable button area? In viewDidLoad: [super viewDidLoad]; scroll.frame = CGRectMake(0, 20, 320, 460); scroll.pagingEnabled = YES; scroll.contentSize = CGSizeMake(320 * 2, 460)

TabBarController, overwriting shouldSelectViewController to do a segue

为君一笑 提交于 2019-12-23 04:33:48
问题 Hi Im trying to change the tabcontroller flow, so when a user is not loged in just take him to the login view instead the settings one. My controller extends TabBarController and I set the delegate as self.tabBarController.delegate=self; My Code is: - (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { if (login) { LoginViewController *loginViewController = [[LoginViewController alloc] init]; UINavigationController

Tab Bar will no work as a subview of another view but works fine as a subview of window?

倾然丶 夕夏残阳落幕 提交于 2019-12-23 04:26:45
问题 I am trying to make a program with three subviews after the title screen. Two of the views are just standard nib files with UIViewController subclassed to control them, and the third is a Tab Bar view. I can't seem to get the tab bar items to display though. I walked through the Tab bar chapter in "Beginning iPhone Development" which adds the Tab Bar Controller right off the bat as a subview of Window in the app delegate and that works fine. What I want to do though is load up my rootView

Autorotation in ios5--most common reasons why it fails?

末鹿安然 提交于 2019-12-23 03:35:31
问题 I'm confused about the implementation of autorotation in ios. I have a UIViewController, and I tell it to autorotate inside shouldAutoRotateToInterfaceOrientation. However, it doesn't work. So I read something about how I need to look at the navigation stack AND/OR whether a UITabBarController was used, because this has been known to cause all kinds of confusion (raises hand). In fact, I have a UITabBar and a UINavigationController. The UIView that I want to rotate is being pushed onto the

UITabBarController/UINavigationController rotation issues

不打扰是莪最后的温柔 提交于 2019-12-23 01:52:44
问题 My problem is the following: I want to only allow Portrait orientation on all my ViewControllers except 1 ViewController which is supposed to allow both Portrait and landscapeLeft/Right. I have now spent almost 2 days into how to set orientation in IOS for different slides/ViewControllers. After some searching I found this thread here at stack: UITabBarController Rotation Issues in ios 6 I followed Kunani's example in that thread which I will post here to save all readers some time: Zack, I

sharing NSManagedObjectContext and other service classes between iphone/ipad tabs

旧巷老猫 提交于 2019-12-22 18:19:43
问题 I am well into building a Core Data tab-based iPad application. I am passing in my NSManagedObjectContext to my root view using the following in my app delegate class. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.rootViewController.managedObjectContext = self.managedObjectContext; [window addSubview:tabBarController.view]; [window makeKeyAndVisible]; return YES; } My question is: how do I set the same managedObjectContext

UITabbarController selectedIndex and selectedViewController do not work

你离开我真会死。 提交于 2019-12-22 12:57:17
问题 I've tried to put following two lines into - (void)viewDidLoad. self.tabBarController.selectedIndex = 3; self.tabBarController.selectedViewController = [self.tabBarController.viewControllers objectAtIndex:3]; At that time, only Tabbar index to change 3 but View Controller remained at default view controller, mean 0. Is there any thing missing in my coding? 回答1: Solution: Try by moving your, self.tabBarController.selectedIndex = 3; self.tabBarController.selectedViewController = [self

Reloading UICollectionView causing flickering

依然范特西╮ 提交于 2019-12-22 11:24:55
问题 I have subclassed a CollectionView and using it using to display a collection of images in different categories. For example: Most Popular, Most Viewed. I access each category/page through a TabbarController. The classes I have are: Main class - MediaList - Base class for fetching and displaying media in a collection view depending on what type of media is requested. SubClasses - MostPopular and MostViewed are both very light classes that inherit from the main class. The problem is that when

How to change default grey color of tab bar items?

筅森魡賤 提交于 2019-12-22 10:53:43
问题 I tried to change default grey color of Tab Bar items, but Xcode finds error. I used some code, that code is: import UIKit extension UIImage { func makeImageWithColorAndSize(color: UIColor, size: CGSize) -> UIImage { UIGraphicsBeginImageContextWithOptions(size, false, 0) color.setFill() UIRectFill(CGRectMake(0, 0, size.width, size.height)) let image = UIGraphicsGetImageFromCurrentImageContext() UIGraphicsEndImageContext() return image } } class SecondViewController: UIViewController { let

How to set tabBarItem's badge from AppDelegate.m (tabBarView is not root View) [duplicate]

拟墨画扇 提交于 2019-12-22 10:49:09
问题 This question already has answers here : Best way to update badgeValue of UITabBarController from a UIView (3 answers) Closed 5 years ago . I can change badge value in AppDelegate.m by following code: UITabBarController *tabController = (UITabBarController *)self.window.rootViewController; [[tabController.viewControllers objectAtIndex:0] tabBarItem].badgeValue = @"Badge"; Only if the tabBarViewController is window's root view controller. However, in my new program, tabBarController is not