How to set delegate to UIActivityViewController of QLPreviewController? - ios

My application's navigation bar buttons color is white..
So I used below code to set color for entire application.
[[UIBarButtonItem appearance] setTintColor:fontColor];
QLPreviewContoller by default having option for UIActivityViewController so while opening MailComposer from UIActivityViewController I am getting white navigation bar button because I have used appearance
Attached screenshot for reference.
Can anybody help me in solving this issue?

Issue is not with QLPreviewController or UIActivityViewController. May be you don't set any colour for navigationBar, by default navigation bar will take white colour as background colour and you are also setting white colour for bar buttons so result will be like above image only. Try to set colour navigation bar using appearance then you can see bar button items.

Related

Set background color (not Text Color) of Back button in UINavigationBar IOS

Is there any way to set the background color of back button in NavigationBar like this
There are some post available on SO which shows how to set Tint color. But can anyone let me know if there is way to set Background Color like shown in image above. or i have to set in custom way?
for navigationBar you should setbackgroundImage
navigationController?.navigationBar.setBackgroundImage(UIImage(named: "your image name"),
forBarMetrics: UIBarMetrics.Default)
I tried with Tint color, but I can not make it work properly.
I do that by adding an UIView at the back of the UINavigationBar. In that case it must be properly positioned using Autolayout.
You have to realize, that is not actually back button background.
If you'll take a closer look at navigation bar, you will see back button has a limited width and height. Something like this:
So if you really need to customize your navigation bar, you have 2 variants:
1) set your navigation bar background image, with fixed or adapting back button background
2) implement custom navigation bar, ignoring system UINavigationBar
You can use custom image and set title manually
[[UIBarButtonItem appearance] setBackButtonBackgroundImage:[UIImage imageNamed:#"customImage"]
forState:UIControlStateNormal
barMetrics:UIBarMetricsDefault];

iPhone not displaying accurate color

I'm working on a simple WebView app where I want the Statusbar to be the same color as the Taskbar from the website.
What I did was setting the background color of the View to the same color as the Taskbarby using the color picker. However when I run the app I'm getting a completely different color as you can see below:
These are the settings for the view:
The color code of the Taskbar is: #242424
However the color code the statusbar gets is: #1b1b1b even though I've selected the #242424 color via the color picker.
Why does it seem to do this?
It has to do with the translucency of the bar, as explained in these answers.
You also have to consider that the view extends under the translucent bar, and the view's background color will slightly change the appearance of any translucent bars above it, because of the visual effect used by the bar.
You may want to not set a specific color for the status bar, and let it inherit the bar's color, to give the task bar and status bar a uniform appearance.
Xcode Colour picker not pick exact same colour. Try this macro(set your colour code)
#define CODE_1_COLOR [UIColor colorWithRed:(140.0f/255.0f) green:(132.0f/255.0f) blue:(124.0f/255.0f) alpha:1.0f]
Also take care about Translucent property in case of navigation bar
[[UINavigationBar appearance] setTranslucent:NO];

How to Set the Navigation Bar Colour in an iOS 8 Launch Screen File?

I'm using a storyboard for my Launch Screen File. It's a very basic setup:
I want to set an opaque colour for the navigation bar...
I can do something like the following in the AppDelegate:
[[UINavigationBar appearance] setBarTintColor:[UIColor redColor]];
But that doesn't apply to the launch screen file.
How do I set the nav bar colour / barTintColor in Interface Builder?
Bar tint is settable for a navigation bar in the Inspector as shown here.
Just checked it with a HOT PINK nav bar in my current project's LaunchScreen.xib and it works fine.
#alexcurylo confirmed that the barTintColor can be set in IB. Part of the problem here was that I couldn't figure out how to select the NavigationBar (I'm not a regular user of Interface Builder)...
Just in case it helps someone else, I was able to select the Navigation Bar, as a child of the Navigation Controller, using the Document Outline pane (I'd failed to do so by left/right clicking on the visual representation...):
Once selected, as #alexcurylo pointed out, it was simply a setting in the Attributes Inspector.

iOS UITabBar Background Image Hides Unselected Tabs

I am using the appearance method for UITabBar to set a Background Image on my tab bar. When I do this, the unselected icons on the tab bar do not appear any. What do I need to do to make sure those are visible, even when not selected?

make transparent navigation bar and transparent tab bar in ios 7.

how to create a transparent tab bar and navigation bar in ios 7 ? i tried setting
[[UITabBar appearance]setBarTintColor:[UIColor clearColor]];
but then a translucent tab bar appears. then i tried setting the translucency property of tab bar to NO
[self.tabBarController.tabBar setTranslucent:NO];
also the tab button is always highlighted in blue color. Even though i put different color images .
has anyone had similar experiences ? observed only in ios7
By default the selected tab button item has highlighted blue color and unselected has gray color. This behavior is a independent of tool bar item image color.
Example to change the selection color for tab Bar item
self.tabController.tabBar.tintColor = [UIColor redColor];

Resources