uitabbar

iPhone SDK warning: class MyAppViewController does not implement the 'UITabbarDelegate' protocol

二次信任 提交于 2019-12-12 01:18:24
问题 Im working on an iPhone app, not using IB, and programmatically created a UITabbar with three items in a UIViewController in a view based application, I used one delegate method, that wont work without the last line in the snippet below( setDelegate method). I dont have a tabbarviewcontroller. UITabBar *tabbar = [[UITabBar alloc] initWithFrame:CGRectMake(0, YMAX-60, XMAX, 40)]; NSMutableArray *items = [[NSMutableArray alloc] initWithCapacity:3]; [items addObject:[[[UITabBarItem alloc]

Support rotation in only one tab on both iOS 5 and 6

放肆的年华 提交于 2019-12-12 01:02:03
问题 My app is a scorekeeper with two tabs. Tab one is where scorekeeping actually takes place, and tab two contains history of past games. Only tab one supports rotation, and when rotating it hides its navigation and tab bars (there's not enough vertical space). I do not want to support rotation at all on the history tab, because the tabbar is hidden in the counter. It is quite jarring to switch tabs and then have the tab bar disappear. There are several types of games that may be displayed in

Xcode 4 - Tab Bar application - Problem in executing third tab

末鹿安然 提交于 2019-12-12 00:34:48
问题 I have Xcode 4 and I created an application using the Tab Bar template (and not View based app). There is a UISwitch in each of these tabs and when I change it, a UILabel switches between ON and OFF . Very simple app and no confusion. Xcode 4 creates two tabs for me by default. I need a third tab as well, so I drag TabBarItem from the Objects Library and drop it on the existing TabBarController. I create a new file, subclass of UIViewController and the following code goes into three tabs. The

How to Set the Selected Item in a UITabBar From within the Code?

六眼飞鱼酱① 提交于 2019-12-11 23:34:06
问题 I'm implementing UITabBar in my app. I managed making it work by implementing UITabBarDelegate in my header file and using - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item in my .m file (as explained in this tutorial). Now, there are 3 scenarios in my app where I wish to set the selected UITabBarItem manually from within the code (and not based on user action): Upon viewDidLoad After didReceiveMemoryWarning In a certain case when the user is entering another view

Remove gradient/Gloss from UITabBarItem

a 夏天 提交于 2019-12-11 23:08:23
问题 I am customizing the UITabBar . I used my custom image in UITabBarItem . The problem is whether there is a gradient/gloss on the item. I checked Apple's app Store didn't had any of this glossy effect on its UITabBarItem . How can i remove gradient from UITabBarItem ? 回答1: You just need to put clear image as `yourImage', it may help you [[UITabBar appearance] setSelectionIndicatorImage:[UIImage {yourImage}]] Edit i just googled it and found lot of similar questions. You can also try below code

Detect a re-tab on selected UITabbarItem

梦想的初衷 提交于 2019-12-11 21:14:56
问题 I'm trying to detect a re-tab on the selected UITabbarItem . I'm using a UIWebview which url needs to be reset to the homepage again after re-tab on the Home button at index 1 in the UITabbar. Problem is: I'm using a storyboard and tried to make the UITabbar delegate, but it's not working. AppDelegate.h: #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate> @property (strong, nonatomic) UIWindow *window; @end didLaunchWithOptions:

Change the image on UITabBar

≡放荡痞女 提交于 2019-12-11 15:37:09
问题 I a complete beginner when it comes to iOS development. I have recently downloaded a template application so I could learn the basics. I am trying to figure out how to change the photo/image on the bottom UI bar. I have done so much research to no avail. 回答1: Here you can find an answer, a category in UITabBar that allows you to set a background image programmatically. 回答2: In iOS 5, UITabBar (and many other UIKit controls) follow a standard procedure for customizing their appearance. Here is

How to change tab bar height programmatically

房东的猫 提交于 2019-12-11 15:21:53
问题 I want to change the height of an tab bar. I changed it this way, but no change occurred. Here's my UITabBarController : import UIKit import SideMenu class TabBarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() setupSideMenu() self.navigationController?.navigationBar.isHidden = true self.tabBar.frame = CGRect( origin: CGPoint(x: 0, y: 20), size: CGSize(width: 400, height: 200) ) } 回答1: I am using an extension for changing height of tab-bar class

setBackgroundImage on TabBar does not work when tapping items

*爱你&永不变心* 提交于 2019-12-11 14:04:36
问题 I can set the background once, but after that it never changes again. I've seen all examples on stackoverflow. The code examples look always the same. I've set the delegate. The images are all ok. I've set them one after the other as default image and the will show. But after the app finished launching nothing happens with the background anymore. Here's my code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [self

How to replace a navigation root controller by tab bar controller in existing iphone app

烂漫一生 提交于 2019-12-11 13:03:36
问题 I have an existing iphone app whihc has nav controller as its root controller. Now i have to add a tab bar controller at the bottom of the screen. how can i achieve this change? 回答1: first you need to create tab bar controller in the root , then you put navigation controller or other view controller for each tab bar good luck 回答2: Are you having more than one viewControllers to be shown in the tab? Add the viewControllers to tabBar's viewControllers. USe this property tabBarController