Objective C - UIImagePickerController customize bottom navigation - objective-c

How can I customize the button and background color of UIImagePickerController's bottom navigation?
In the image below, it would be the "cancel" & "choose" button and the background.
Thank you,
Tee

I doubt you can do any customizations to default controls. You can have complete customized view (preview view) if you set showsCameraControls to NO.

Related

How to display both text title and loading icon on the middle navigation?

If user clicks the icon, refresh starts. I found this https://github.com/Just-/UINavigationItem-Loading library, but it can't display both text title and loading icon on the middle navigation.
Like this photo:
Navigation item has property named "titleView".
Crete your view as you wish with label and reloadButton and then assign titleView this view:
self.navigationItem.titleView = [self getCustomView];
UINavigationBar is kind of UIView, You can do addSubView: in that. So add UILabel & UIActivityIndicator.
Let me know if you need anymore clarification.
Refer this link for code

Resize views when menubar autohides/appear in fullscreen mode

I'm working on an OSX app that supports a fullscreen mode.
The window is generated from a nib file but everything else is handled programmatically.
When I goes in fullscreen mode, my views resize properly but when the menu bar appear/disappear, setFrame don't get called for either the contentView or my own views. I'd to be notified
Is there a delegate to implement to catch those notifications? Or do I have to subclass NSWindow and find out how Safari handles its menu bar by reversing it?
It would be helpful to see some code, how exactly "your views resize properly".
But next info might help:
When a window goes fullscreen it occupies entire screen after the end of the fullscreen animation. The main menu bar shows over the window ("above" in sense of z-ordering). So when main menu bar shows/hides frame of your window and content view don't change.
Also note, that -[NSScreen visibleFrame] returns unoccupied frame. And it will not return whole screen frame until the end of the fullscreen animation.
After some researches, I could at least get ride of the dirty gray bar at the top of the screen by subclassing the window's content view and add the following code to the setFrame method, before call super:
//isFullscreen
if(([self.window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask)
{
frameRect.size.height = self.window.frame.size.height;
frameRect.size.width = self.window.frame.size.width;
}
The window get resized to the screen size before setFrame get called, so we can use its size to update frameRect to window's size.

Delete the grey bar at the bottom of the UIView

Why does all my UIViews have a grey bar at the bottom. I can hide it in runtime with the code self.navigationController.toolbarHidden = YES;
But I need it hidden in development mode. I have tried changing the navigation controller properties to bottom bar = non, did nothing.
How can I get rid of this grey bar at the bottom in development mode?
Select your navigation controller and open the attributes inspector. Make sure the Bottom Bar property is set to None.
You can also do the same for individual viewControllers.

How can an iOS7-style "Now Playing" button be added to an UINavigationBar?

I'd like to add an iOS7 Music app style "Now Playing" button to the UINavigationBar
The button should have:
two lines of text
a right pointing chevron
How can this be achieved?
You will probably need the image for the chevron. If that's okay for you then you can create a UIButton with proper title and image insets and pass to initWithCustomView: method.
Note: you will also need to set numberOfLines = 2 for this button which as far as I know you can not do in IB

Rotating UITabBarController Icon

I have an UITabBar in my application. One of the tab bar icons looks like a loading symbol. When the user presses the loading button I want the icon to spin/rotate until the loading is done. Should I use UIImageView to animate or something else? How should I make this happen?
Jacos, unfortunately you cannot do that with the UITabBarController and manipulate the tabBarController's tabBar properties. My best bet would be that you use a UIToolBar and assign a black color and make it appear like a tabBar and have buttons added in them as a subView so that they look like tabBarItems.
Its much more customizable, and you can even provide a scrolling experience and add more buttons to it.
I know this question is 4 years old but I had the same problem and managed to fix it by reading the tutorial in here:
https://medium.com/#werry_paxman/bring-your-uitabbar-to-life-animating-uitabbaritem-images-with-swift-and-coregraphics-d3be75eb8d4d#.bjfpbdnut
The main point is to get the view for desired UITabBarItem and the get the UIImageView from it in viewDidLoad:
UIView *plusView = self.tabBar.subviews[1];
self.plusImageView = plusView.subviews.firstObject;
self.plusImageView.contentMode = UIViewContentModeCenter;
Then in didSelectItem method you can do this:
[UIView animateWithDuration:0.4 animations:^{
[self.plusImageView setTransform:CGAffineTransformMakeRotation(M_PI/4)];
}];
My code only rotate the image view for 45 degrees but you can change as you wish.
I guess you could change the UITabBarItem's icon on a timer, but that seems pretty kludgey. You would have to pre-render each frame of your "loading" icon rather than rotate an ImageView.
Another hackey solution would be to add your ImageView to the UIWindow and move it on top of the TabBarController's TabBar (adding it to the TabBar itself is asking for trouble).
You shouldn't try to animate the actual UIImageView within the UITabBarController. I would take this approach:
Set the image for the relevant tab to nil or a blank image.
Create a UIActivityIndicatorView and add it over the tab bar. Position it over the correct tab.
[self.tabBarController.tabBar addSubview:activityIndicatorView];
When your loading task has completed, restore the normal image to the tab and remove the activityIndicator from the tab bar.