Three20 library - subclass of TTPhotoViewController has an opaque navigation bar - iphone

I am using a TTPhotoViewController subclass from the Three20 library for showing images from a web location. The images load up fine but the navigation bar and toolbar show up with the default tint. I am using a nav bar with a custom tint (set in the MainWindow.xib)
I tried these things to get it to show black translucent bars but none of these seem to work.
setting the navigation bar style to black translucent in MainWindow.xib
setting the navigation bar style to black opaque in MainWindow.xib
Explicitly setting the navigationbar style to black translucent in the subclass's viewWillAppear:
Can someone please tell me why this would happen and how I can solve this? Thanks.

EDIT: I'm an idiot. You're trying to set the style, not the color. The below is all valid information, but what you almost certainly want is the navigationBarStyle property defined by TTViewController. Sorry.
Three20 has a "style sheet" mechanism built into it, the intended purpose of which is to save you from having to set tint colors, fonts, etc. on all of the many UI objects in your app, over and over. However, if you don't know it's there, you end up in exactly this situation. What you need to do is:
Create a subclass of TTDefaultStyleSheet in your application, and override at least this method:
- (UIColor*)navigationBarTintColor {
return RGBCOLOR(119, 140, 168);
}
Someplace in your app (probably applicationDidFinishLaunching:), call:
[TTStyleSheet setGlobalStyleSheet:
[[[YourStyleSheetClass alloc] init] autorelease]];
(You might want to browse around in TTDefaultStyleSheet.h, because there are a whole pile of other styles defined there that are used by the framework, and that you might also want to override.)

Related

Change the color of a automatic generated NavBar?

So I've created a tab bar application with more than five tabs and therefore a automatic generated Navigation bar comes to life. Fair enough, only thing is, that I want a Black opaque Navigation bar. Seen the questions about this asked before, but none of the info there helped me any. Anyone has a complete code for this? What to put in the .h and .m file?
I want the navigation bar black, the "edit"-button black, the "done" button black, the "back"-button black and also the other automatic generated navigation bars to be black. I'm sorry if I'm asking to much here, but there ain't so much info on the particular topic.
In advance, thanks!
Best regards,
Øyvind Larsen Runestad.
That's the property you're looking for:
#property(nonatomic, retain) UIColor *tintColor;
As for changing the color of the items, it's a matter of changing the color of every single UINavigationItem. See this question to know how to do it:
Change UINavigationItem colour
As for "What to put in the .h and .m file?" you should write the code whenever you need to change the color of the items, so say that you need it when the view is loaded, then you do it in the viewDidLoad method, provided that you have already added the navigation bar.

How to tell UINavigationBar to ignore a custom category?

I'm having a little problem with customising an app's navigation bar and using an image picker.
I have a category that overrides the drawRect method of the app's nav bar, it changes the background image to a mostly white image. This works fine except when I call an image picker to let the user choose a pic from their library.
Firstly the image picker's nav bar displays the custom image but its title text is white which gets lost on the white background. And secondly the status bar is semi transparent which looks weird against the white navbar.
Is there anyway I can tell the image picker's nav bar to ignore the category I created and to use its default drawRect method?
Many thanks for any advice.
You cannot make a category apply only sometimes. The way categories work means that you use it always or never. The only workaround I can think of is to somehow check inside of the categories' overridden method to see what instance you're in.

Really cool way to create custom UITabBar for iPhone app?

I am doing a lot of researching lately about how to get a different looking with nice effects UITabBar on my iPhone app, but unfortunately I am only finding things on how to replace background color etc.
Well, I've checked out this app called Momento which is pretty cool and presents a very slick tabBar:
So there are a couple of elements here I would like to ask you guys if you could help me by giving me the right directions on how to get a similar effect :)
Arrow above items: as you can see this app has this animated arrow that runs above the selected item with a very smooth animation.
Selected Stated of the item's image is not that blue-ish default one neither the default state which displays in a different shade of brown and gray version.
nice Items separators with beveled vertical lines.
different background image for the tabBar
different height for the tabBar
At this point after some research I am able to set the height and background image by subclassing UITabBarController but I'm still not sure on how to accomplish the other items specially the first one related to the nice arrow effect.
How do I do this? Please clarify what can or can't be done by subclassing the UITabBarController and specially if can be done in Interface Builder.
There's a project on github called BCTabBarController that aims to mimic the tab bar used in Twitter for iPhone. It's got some of the things you're looking for, and should give a great starting point.
Both of these are good answers, but both libraries have problems: BCTabBarController doesn't know how to create the "blue" highlighted version of a tab bar icon; and iDevRecipies doesn't send events to child viewcontrollers nor resize the navigation bar on rotate.
Be warned: custom nav bars are a lot of trial-and-error debugging (as I have found).
Simply use a UIView with TabBar width and height.Add custom background image and custom buttons on the view.Set the fileowner of the view as AppDelegate.Now you can simply connect the IBActions with the buttons.The Custom view can be placed over the tabbar by addSubView to the TabBar controller's view.You can switch between viewcontrollers by using the setSelectedIndex method of tableviewcontroller in the button action.

Customise top bar of an iPhone application

Is it possible to customise the top bar of an iPhone application (not a website)? If so, how can I change the background colour to orange?
If you are talking about the very top bar (with the wifi-strength etc) then it's impossible following the AppStore-rules. You can change it to black only.
It's however possible with various jailbreak-tools, but then you can't publish your app to app store.
So, I'm guessing here you could be talking about a UINavigationBar or a UIToolBar, but that doesn't really matter because yes, you can change the colour of either.
In Interface Builder, select the UINavigationBar (or UIToolBar) and under properties look at "tint". This will be set to "default" initially. You can then pick any colour (even orange!) as the tint colour, and there you go!
You can do so by using the tintColor property of the navigation bar.
I have implemented and checked it. its working.
self.navigationController.navigationBar.tintColor=[UIColor orangeColor];
hAPPY cODING...

iPhone - Custom Tab Icons, Remove Highlight

I am creating a custom tab bar for my iPhone app and I need to change the images. I have changed the actual tab bar background, but I need to know how to add custom images for the icons and their respective "selected" icons. I also need to remove the square highlight that is default. Pretty much, it just needs to be my icons. Also wondering if the images can be coloured or not. I've looked a lot of this, but no one seems to have the solution.
Someone please help.
hide the inbuilt tabBar view
create your own custom UIView (or UIScrollView in case if you need more number of tabs) with the frame of inbuilt tabBar view and fill up, especially with array of UIButtons & then add your custom view as a subview of the TabBarController.
Play with the UIButton's background image (which is your tab icon image) and its addTarget:action:forControlEvents: in order to set the appropriate selectedIndex value of the TabBarController, i.e. set the selectedIndex according to the button's position in the custom view.
This is how I've implemented :)
No. You cannot customise the tab bar icons in the UITabBar.
They are designed to be used with an alpha masked image.
Someone discovered a way to hack the colours though here: Custom colors in UITabBar