I am customizing MFMailComposeViewController. For changing it's UI I detected the UIBarButtonItem and changing it's appearance using:
[[UIBarButtonItem appearance]setTitle:#""];
I am getting crashed in my other classes where I used UIBarButtonItem with text. I fixed those by using customView for the bar button. I am also using share kit in my app and now I am having crash in twitter login screen when keyboard appears with toolbar (In next/Previous and Done buttons).
Is there any way to avoid crashes in my app's other bar button items after I set appearance for a specific class?
Is there any way to assign customView to ShareKit's twitter's login screen's buttons?
Is there any way to remove those bar buttons if no for both above?
Thanks.
UIBarButtonItem appearance proxy does not have a method for setTitle.
In the documentation you will find wich method are available for Customizing Appearance
You can't customise the appearance of the MFMailComposeViewController.
From Apple's docs on the class:
"The mail composition interface itself is not customizable and must not be modified by your application."
Related
Thanks for reading my question!
I have a 5-part tabbar which I use for app navigation, the center tab is covered by a UIButton and is slightly larger (much like the instagram app). This works fine.
But what I want is the far right tab bar item to show a overlaying menu when clicked. I don't want it to switch to a viewcontroller with a menu. I want the menu to be displayed no matter which of the other views you're in at the moment. So I want it to act much like a button which is in the tabbar. But I have no idea how to go about doing this.
Should I use a overlaying button over the tabbaritem or should I catch the tabbarclick, but how can I prevent the view from changing in that case?
Thanks you for any help!
You need to implement UITabBarDelegate. Then override tabBar:didSelectItem: and implement your custom displaying here. See below for reference
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarDelegate_Protocol/Reference/Reference.html
Then i would just make a custom UIView and fade it in when that specific tagged UITabBarItem is pressed.
Question
In the docs for MFMessageComposeViewController apple says:
Important The message composition interface itself is not customizable and must not be modified by your application.
But navigationbar and barbuttonitems in the MFMessageComposeViewController and the MFMailComposeViewController are inheriting all the styling I've done through UIAppearance.
I tried to revert to default appearance by using UIAppearance containment and setting the navigationbar/barbuttonitem background images to nil, but I couldn't figure out how to restore the default titleTextAttributes for the navigationbar and barbuttonitem.
I tried going the other route and using containment to restrict the styling to my navigation controller, but it seems like MFMessageComposeViewController and MFMailComposeViewController are contained within my navigaton controller anyway, so this isn't helping.
So my questions are:
1) will changing the navbar appearance on MFMessageComposeView and MFMailComposeView be an issue at app store approval? (if it's not an issue I can keep the custom styles.)
2) is there a way to present the ComposeViewController so that it won't be contained within my navigation controller?
3) or simply, how can i restore the default title text attributes for the barButtonItems and navigationBar?
It seems to be a rather old question, but:
1). No, changing appearance of navigation bar will not affect AppStore approval. Mentioned Apple note is related to fields of MFMessageComposeViewController (e.g. To: Cc: ...), not the navigation bar. (We had an approved app with such customized navbar)
2, 3) No need for that =)
I want to have this type of bar at the bottom of the application and whenever a button is clicked new buttons should popup, which one of them when clicked should take me to its connected view
You shouldn't use Popup as control, I'll recommend you to use it like a notification as this is not Apple way of showing controls.
Here is a nice link from boctor iDev recipes.
You can find here custom UITabBar as well Notification
I would suggest you not to try customizing UITabbar. This will go against the normal behavior of UITabbar and Apple may reject your app for tampering with normal behavior.
You can try having a UIView with a set of buttons in them and bring the similar functionality as in your image.
I'm developing (for learning iOS programming) an application for images-sharing.
The wanted layout is this:
It's a tabbar application with three tabs.
When you open the application and you're not logged the tabbar is hidden and you see instead a toolbar with two buttons "SIGNUP" and "LOGIN".
The controller that you see when you open the app it's the same for logged and anonymous users. The anonymous users can see only this because the tabbar (as written above) is hidden and you see instead a toolbar for signing up and log in.
When you tap on login or signup button you see (with pushViewController of navigationController) a new pushed view for do the selected action.
For example you're an anonymous user and you open the app. You see the first controller with all images and a UIToolbar at the bottom with the two buttons. For example you tap on an image and you see a new view with the image details (the view is pushed with navigationcontroller). But also in the new view you can see the UIToolbar for sign up and login. So the UIToolbar it's always visible for the anonymous user.
My problem is always display the UIToolbar for anonymous users and push with a navigationcontroller the login or signup views.
I'm a newbie developer. Have you tips for do that? Thanks.
If I understand your problem correctly, you want to constantly display a UIToolbar for an anonymous user so that they can log in from any of your views? If this is the case, all you would have to do is include your login toolbar in every one of your views you want the user to be able to log in from.
Another option, if I remember correctly, a navigation controller is technically both a top bar and a bottom bar. You could enable and utilize this bottom bar instead of adding your login toolbar to each of your views. To disable it for a know user, you would simply just hide it.
Edit in response to comments:
You should initialize the toolbar in your UINavigationController subclass, it would look something like this:
customNavController.h:
#property(nonatomic,retain) UIToolbar *toolbar
customNavController.m
if (toolbar == nil) {
toolbar = [[UIToolbar alloc] init];
navigationController.toolbar = toolbar;
}
That's the basic idea, though your initialize function for the toolbar will be different in that it will have the necessary UI for the login process. If you want some more information on the Navigation Controller I would highly recommend reading the class reference on it, it is actually very handy.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UINavigationController_Class/Reference/Reference.html
I have an iPad application with screen flows which don't map neatly to the navigation controller model, but still have the concept of "Back".
I'd like to manage my own toolbar and have a "Back" button where I decide where it goes.
Is there a way to make a toolbar button have the look of a back button as in UINavigationBarItem?
Thanks
Basically, you either have to use undocumented APIs, or create a custom button with a custom image.
This question:
Creating a left-arrow button (like UINavigationBar's "back" style) on a UIToolbar
has answers that cover both ways.
(Placing a UINavigationBar back button look alike icon somewhere other than the left of what looks like a UINavigationBar is probably against the HIG and may result in non-approval of the application, though perhaps only if you're unlucky.)