uitabbaritem

show all tabs with scrolling option (on screen there should be only 4 tabs)

只谈情不闲聊 提交于 2019-12-18 09:33:23
问题 I am newbie for iOS development. What I have done so far is as below. Created New Project Removed all controller and added View Controller. Dragged ScrollView in ViewController Dragged Tab Bar in ScrollView Dragged 7 Tab Bar Item in Tab Bar . Now when I execute this project, I have all 7 tabs on screen which is not looking good. So what I am planning is display only 4 tab at first and if user scroll it horizontally, user can scroll and see rest tabs. So, what I want to achieve is

show all tabs with scrolling option (on screen there should be only 4 tabs)

半腔热情 提交于 2019-12-18 09:30:03
问题 I am newbie for iOS development. What I have done so far is as below. Created New Project Removed all controller and added View Controller. Dragged ScrollView in ViewController Dragged Tab Bar in ScrollView Dragged 7 Tab Bar Item in Tab Bar . Now when I execute this project, I have all 7 tabs on screen which is not looking good. So what I am planning is display only 4 tab at first and if user scroll it horizontally, user can scroll and see rest tabs. So, what I want to achieve is

Detect UITabBar Selected Index/ Item Changes that is set Programmatically

两盒软妹~` 提交于 2019-12-18 05:39:06
问题 I would like to know how do we detect when the selected TabBar Item or Index is changed when the changes is done programmatically ? self.tabBarController.selectedIndex = 1; This two delegate function only detect changes when the tabBar Item was selected by user. It does not fire when the changes to the selectedIndex was done programmatically. func tabBarController(tabBarController: UITabBarController, didSelectViewController viewController: UIViewController) { println("tabBarController

Swift setting Badge Value for UITabBarItem

∥☆過路亽.° 提交于 2019-12-18 03:02:23
问题 I'm attempting to add a badge alert label like the one in the screenshot attached. I've tried to search for titles, labels uitabbar items but I'm stuck. Any suggestion is appreciated. 回答1: Xcode 7.2.1 Swift 2.1.1 You just have to set the badgeValue for your desired UITabBarItem as follow: tabBarController?.tabBar.items?[4].badgeValue = "1" // this will add "1" badge to your fifth tab bar item // or like this to apply it to your first tab tabBarController?.tabBar.items?.first?.badgeValue =

Customize the More UIBarButtonItem in UITabBar

喜欢而已 提交于 2019-12-17 19:56:01
问题 Since iOS 5 Apple provided an API to customise the UITabBarItems in the UITabBar object. I am refering specifically to the following selector: setFinishedSelectedImage:withFinishedUnselectedImage: It all works great for regular buttons but I can't seem to customise the "More" button to match the style of the other ones. This is what I am doing: tabBarController.viewControllers = tabBarControllerArray; tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackColor];

How to remove programmatically a tab bar item created in parent class NIB file?

北战南征 提交于 2019-12-17 19:35:36
问题 Within my iPhone application I have a common tab bar with three tabs that is presented from several views after pressing a button. The approach I followed was the workflow of Tweetie application, described in Robert Conn post. Note that the main controller is a navigation controller; the tab bar is placed in a view controller's NIB file of the navigation stack, and the effect of switching between tabs is handled in a delegate didSelectItem method. @interface GameTabBarController :

tabbar item image and selectedImage

笑着哭i 提交于 2019-12-17 16:23:46
问题 I have a tab bar controller (its a tab bar based application, so tab bar is on MainWindow.xib). In this xib, I have added 4 tab bar items and I have set the image of all tab bar item. Due to this, I am facing 2 issues: 1) The image is white-colored, but when I run the application, its showing all the images on tab bar item as gray colored. How can I make it look same as is in the original image. 2) I have a selected image, that I want to add on the tab bar item which is currently selected.

iOS Tab Bar icons keep getting larger

让人想犯罪 __ 提交于 2019-12-17 15:49:10
问题 I am having a problem with my icons in my tabBar . Tapping the same tab bar button repeatedly will keep increasing the tab bar icon's size. If I push a different one, it goes back to its original size. Any ideas what I should fix? 回答1: As per the project shared by the OP ( see question comments ), it seems the tab bar image insets seem to be messing things up. Steps to resolve the issue: Select the tab bar item of the problematic ViewController s in IB Go to Size Inspector section ( on the

Set custom images to the UIBarButtonItem but it doesn't show any image

不想你离开。 提交于 2019-12-17 10:00:46
问题 I want to set custom images to the UIBarButtonItem but it only shows a rectangular box around and It doesn't show the actual image. func setupBrowserToolbar() { let browser = UIToolbar(frame: CGRect(x: 0, y: 20, width: self.view.frame.width, height: 30)) //配置返回组件 let path = NSBundle.mainBundle().pathForResource("back", ofType: "png") let urlstr = NSURL(fileURLWithPath: path!) let data = NSData(contentsOfURL: urlstr) let btnback = UIBarButtonItem(image: UIImage(data: data!), style:

What size should TabBar images be?

两盒软妹~` 提交于 2019-12-17 08:10:12
问题 I have icons for a tabBar of size 100. I checked at Apple's Human Interface Guidelines and it says the image size should be 30x30 / 60x60 . But as the height of tab bar controller is 50, I kept the size of the image at 50x50 . Now, when I run the project, I see the ugly design below: Any idea what size images I should use so that the design will be perfect? Note: I am not writing text also (e.g. Home, Search, etc). The text of the tab button is there in the image itself. 回答1: 30x30 is points,