uitabbar

UITabBar selectionIndicatorImage height on iPhone X

旧巷老猫 提交于 2019-11-30 09:03:53
I'm using a selectionIndicatorImage for a UITabBar , which is 49 points high, like this: UITabBar.appearance().selectionIndicatorImage = UIImage(named: "bg-tab-selected") Works just fine across all devices: Except for the iPhone X: I've tried setting the images to be vertically sliced only in the asset catalog, but that doesn't seem to have the desired effect. For some reason it also stretches horizontally? And there is a bit of padding on top. Any ideas how I can fix this? I had the same issue. I "fixed" it by subtracting the height by 1 pixel, so 48 pixels for the height of the selection

UINavigationBar appearance refresh?

强颜欢笑 提交于 2019-11-30 08:13:17
In my iPad app I have an application settings view. One of the options lets the user switch interface color scheme. The settings view is loaded by segue to a separate view controller than my "main" app's window. When they pick a new color I switch the colorSchemeColor variable and do this: // set the colors and refresh the view [[UINavigationBar appearance] setBarTintColor:colorSchemeColor]; [[UIToolbar appearance] setBarTintColor:colorSchemeColor]; [[UITabBar appearance] setBarTintColor:colorSchemeColor]; However, none of the bars change color until I exit my settings view! (When the settings

Programmatically pressing a UITabBar button in Xcode

你。 提交于 2019-11-30 08:08:56
问题 Sorry for the newbie question. I have a UITabBar in my main window view as well as an array of UINavigationControllers for each Tab. The structure is similar to the iPod app in that the main views can be seen by selecting TabBar items and then the user can drill down further with the NavigationController by pushing views to the stack. What I would like to be able to do is to do the equivalent of pressing a TabBar button at the bottom from any of the subviews in code (i.e., change the selected

Making a thinner UITabBar

你说的曾经没有我的故事 提交于 2019-11-30 07:42:21
I would like to be able to thin the UITabBar's height by removing each item's titles and reclaiming the vertical space they take up, a la Tweetie 2. This doesn't seem settable in the .xib or programmatically. Will I have to subclass the UITabBar and roll my own? Roll your own. I'm sure Tweetie 2's is custom; and the height is set in the handed down UITabBar. You can achieve a similar effect by placing a segmented control inside a uitoolbar. I did this and it looks quite nice. 来源: https://stackoverflow.com/questions/1563701/making-a-thinner-uitabbar

Colour changed in iOS7.1, how to change searchBar colour?

耗尽温柔 提交于 2019-11-30 05:28:37
On iOS7.0.3 - 7.0.6, my searchBar colour is Gold/yellow colour like this: But on iOS 7.1, colour becomes like this: I set searchBar.tintColor = [UIColor clearColor]; searchBar.backgroundColor = goldColor; searchBar.tintColor = [UIColor blackColor]; I've tried so many ways and all are failed. Can anyone figure out what changes in iOS 7.1? ============== My fix =============== I fix this problem by covering a view on searchBar and add the search text filed as subview on this new view. I need point out that the gold status bar is a subView of searchBar, and it's frame is CGRectMake(0, -20, 320,

Set tab bar item selected image in xcode 6

好久不见. 提交于 2019-11-30 05:16:25
This is my setup for a tab bar item: However when clicking on the item inside the app the 1051-id-badge-selected image is not shown, instead nothing is shown: Is something wrong with my setup? Any ideas? To get around this issue and set selected image without writing any code, we can also use "User Defined Run Attributes". Select the tab bar item, then in 'Identity Inspector', add a new value from 'User Defined Runtime Attributes'. Set the 'Key Path' to selectedImage , and choose 'Type' Image , then fill in the 'Value' with your image name. If the inspector solution is not working for you (e.g

UItabbar item not showing storyboard reference

孤街醉人 提交于 2019-11-30 04:20:54
I'm trying to use the new storyboard references in a tabbar. When I use the storyboard reference, the UITabBarItem (with customized image & text set), isn't showing anything. See setup: storyboard setup tabbaritem setup I fixed it for now by setting the images & title in the initWithCoder function for the initial viewcontroller in the referenced storyboards like so: static NSString *const ContactsViewControllerTabContactImageName = @"tab-contact"; static NSString *const ContactsViewControllerTabContactActiveImageName = @"tab-contact-active"; - (instancetype)initWithCoder:(NSCoder *)aDecoder {

Is it possible to remove the images in the UITabBarItem and aligned vertically the title

可紊 提交于 2019-11-30 03:51:51
问题 I have a UITabBar but i don't want to set the images I just want to set the title, and I want this title to be aligned vertically. Is this possible? Thanks 回答1: Not that I know of. I think you'd need to create images of your text labels (either in advance in your graphic tool of choice, or you can create them programmatically at runtime). If you want to do it programmatically, a method like the following might do it. It creates a center-aligned image using the text you pass it, performing

Completely transparent UITabBar in iOS 8

Deadly 提交于 2019-11-30 03:38:25
I'm trying to make my tabBar transparent, I've searched but all I found was articles resulting in partly and not fully transparent tabBars and some were for IOS 5, etc. I would like to accomplish this as seen in Sketch 3: What's the easiest way to accomplish this? I thought of doing this: // Make the tabBar transparent self.tabBarController.tabBar.backgroundColor = [UIColor clearColor]; self.tabBarController.tabBar.translucent = YES; but that result wasn't exactly perfect: Really appreciate help!:) Sincerely, Erik Update // Make the tabBar transparent [[UITabBar appearance] setBarTintColor:

ios tabbar put text in the middle when no image

醉酒当歌 提交于 2019-11-30 01:49:15
问题 My tabbar consists only of text, no images. The problem is that the text always show on the bottom of the tab, is there a way to position the text in the middle ? Thank you 回答1: Got it! [tab.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)] 回答2: A supplement, if you set multi viewControllers in tabBarController, you should use the following: for (UITabBarItem* item in tabBarController.tabBar.items) { [item setTitlePositionAdjustment:UIOffsetMake(0, -10)]; } 回答3: swift update. func