uitabbar

How to clip larger images to fit into tabBar icons in tabBarController built programmatically.

妖精的绣舞 提交于 2020-01-13 08:58:30
问题 I have created a tab controller programmatically. Now, I wanted to add images to the different tabs, for which I used : self.tabBarItem.image = [UIImage imageNamed:@"Sample_Image.png"]; The problem is Sample_image is larger in size than is required by tab. So just want to know how can I clip the image to fit into tabs. 回答1: Sample_image is larger in size than is required by tab. Try this piece of code as this will resize the required image and return an UIImage instance with 30x30 size (size

setting tint color for selected tab in UITabBar

ⅰ亾dé卋堺 提交于 2020-01-13 08:46:12
问题 In Xcode 5 Dev Preview 2, I was able to execute the following: [[UITabBar appearance] setTintColor:[UIColor whiteColor]]; //the color of the selected image and text (white) In Xcode 5 Dev Preview 3, the same line of code throws an exception (see below). The exception indicates that I may want to use ' barTintColor ' - but I do not - as this is the color of the overall UITabBar. How can I set the color of the selected image and text in a UITabBar? The new exception in Xcode 5 Dev Preview 3: **

How to recreate the UITabBarItem image filter?

十年热恋 提交于 2020-01-11 19:57:22
问题 I'm writing a custom UITabBar replacement, and I would like to know how to recreate the filter that the built-in implementation does with the UITabBarItem image - that blue shining on selected tabs and gray gradient on unselected ones. I guess it's a matter of using the source image alpha value as a mask and overlay it with a pre-made blue (or whatever color) shining image and another one grayed out, but I would like to know what is the best approach from a code point of view. Best, 回答1: Edit

How to set badge value in Tab bar?

谁说胖子不能爱 提交于 2020-01-11 15:10:09
问题 i have to read datas from xml and have to display values in view controller. am using tab barcontroller . where i have to read xml data and have to display it in tab bar as badge. here is my controller code. -(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict { if([elementName isEqualToString:@"Event"]) { //Initialize the array. rssOutputData = [

UITableView last cell hidden by UITabBarController

六眼飞鱼酱① 提交于 2020-01-11 14:01:23
问题 I am facing a strange issue. I have a UITableView in the initial UIViewController of the UITabBarController . At first everything is alright, but when I change the tab and come back to first tab the last cell of UITableView is hidden by the tabbar. How can I fix this? 回答1: select your specific ViewController from storyboard then un-check Under Bottom Bar property. 来源: https://stackoverflow.com/questions/20994765/uitableview-last-cell-hidden-by-uitabbarcontroller

Is it possible to change UITabBarItem badge color

妖精的绣舞 提交于 2020-01-09 06:20:30
问题 I want to change background color of UITabBarItem badge but can't find any resource on how to make it. 回答1: UITabBarItem has this available since iOS 10. var badgeColor: UIColor? { get set } It's also available via appearence. if #available(iOS 10, *) { UITabBarItem.appearance().badgeColor = .green } reference docs: https://developer.apple.com/reference/uikit/uitabbaritem/1648567-badgecolor 回答2: Changing the badge-color is now natively supported in iOS 10 and later using the badgeColor

Simulating selected tab bar effect

北城余情 提交于 2020-01-07 04:40:49
问题 Partly as a programming exercise, and partly because we may need to include such images in an app some day, I've been trying to figure out how to draw an image like the selected tab in a UITabBar . The basic operation is simple enough in concept: the icon's alpha is used as a mask to draw the blue gradient image onto the tab. (Though I can't for the life of me figure out how one actually uses an image's alpha as a mask in Core Graphics. I ended up drawing the gradient first, then using a

How to show tabbar icon full size in iPhone SDK?

怎甘沉沦 提交于 2020-01-07 04:03:26
问题 How to show image icon of tabbar in full size like in this image you can see. This is my image here you can't see the image is going to be not perfect How to show my image looks like the above image show I have used for showing image this code navigationController2.tabBarItem.image = [UIImage imageNamed:@"camera_btn"]; Hey I have found the solution for that but I can't know how to change the tabbar controllers view and i can't make my camera button like they do here I am creating tabbar

how to fire the tabs in a custom uitab bar

老子叫甜甜 提交于 2020-01-07 01:48:57
问题 I created a custom UITabBar, like this: and I want when the user clicks on any tab, to open the corresponding content, (which is in both cases tableView) i thought that i have to add two view controllers and then call them whenever a bar clicks. so i ended up like this: then i saw my problem, i am not loading the content of the view controller inside but when a user clicks in my case now, a new view controller opens. what am i missing please? 来源: https://stackoverflow.com/questions/34245150

UIWebView throwing NSUnknownKeyException iPad

萝らか妹 提交于 2020-01-06 22:43:07
问题 I have a tab bar application. Everything works normally, and I can switch between tabs fine and everything, except when I switch to my second tab ProductViewClass the view doesn't update and it spits out the console output below. I have nothing in this view except for a UIWebView and a UILabel. When I delete the UIWebView it runs successfully, and when I add another it still works. It only stops working when I connect the IBOutlet from my File's Owner to the UIWebView. Besides synthesizing