Using EGOPhotoViewController with iPhone 5 - iphone

Using this on iPhone 5:
EGOPhotoViewController *photoController = [[EGOPhotoViewController alloc] initWithImageURLs:imageURLs];
[self.navigationController pushViewController:photoController animated:YES];
When I get back to the caller I can see the bottom bar... How should I solve this?
That doesn't happen on 3.5 inch screen.
UPDATE:
Same problem happens on EGOPhotoViewer_Demo
This is how the screen looks on the first usage:
When getting into "Photos" and go back to that main screen it change to:
You can see something hides the bottom of the screen. On my app I have buttons there so it's problematic.
Hope this update makes my problem more clear.

I’m not sure but this might be a duplicate of iPhone 5 app displaying correctly but not sensing touches in “extra” space
Also, do you have the same problem on iOS 6? From the screenshots, it seems you are using iOS 7, which could be the source of your problem.

When compiling with Xcode 5 the problem is solved (test device was iOS 7).

I had the same issue.
The problem is the following statement in viewWillAppear:
[self.navigationController setToolbarHidden:NO animated:YES];
Move this statement and the accompanying "if" test to viewDidAppear and the problem goes away.
To be honest I am not sure why this ever worked - but it makes sense that showing the toolbar when our photo view is not yet up would show the toolbar in the parent view, not the photo view. Moving it to viewDidAppear does the right thing.

Related

FBFriendPickerViewController for iOS 7 doesn't work as expected in landscape mode

I am working for Facebook integration in my iPad app. I am using FBFriendPickerViewController for same. My app is working fine on iOS 6 for landscape as well as portrait mode but when I use iOS 7 then friend picker controller works fine ONLY for portrait. When try to launch it in landscape mode then white view pops up. I could see faint friend picker view in background but very hard to see that. Do anyone have any idea what must be the reason? Code base I have used is as below.
if (!_friendPicker) {
self.friendPicker = [[FBFriendPickerViewController alloc] init];
// _friendPicker.delegate = self;
_friendPicker.title = #"Select a friend";
_friendPicker.allowsMultipleSelection = NO; // Share dialog doesn't allow more than one recipient
}
[_friendPicker clearSelection];
[_friendPicker loadData];
_friendPicker.modalPresentationStyle = UIModalPresentationFormSheet;
[_friendPicker presentModallyFromViewController:self
animated:YES
handler:nil];
Same thing I have observed on facebook sample app "HelloFacebookSample" :)
Try:
Get the newest Facebook SDK, because in the above link a Facebook rep says the issue should be resolved. The modal frame still takes into account the space for the status bar so you'll have to find a way to deal with it (doesn't bother me enough to spend time solving it at this point).
I also removed a [[UINavigationBar appearance] setTitleTextAttributes:]; line from my app delegate, so maybe try removing all nav bar customisation and see what you get.
Good luck.

View size and position for iOS7

I am having a weird problem in iOS7 and iOS6. If anyone could help me out.
Problem :
- in iOS6 and earlier the view coordinates starts after NavigationBar but in iOS7 the view coordinates starts after StatusBar and calculate NavigationBar in the View. So what ever looks fine in iOS6 will spoil in iOS7. The NavigationBar hides the top 44 px of the View in iOS7.
I tried to search on internet but could not find any proper solution. I can pragmatically arrange the views by iOS7 condition. But I know its not a proper way to do it. So if you know how to resolve this issue, please guide me. I have attached 2 screenshots one is from iOS6 and the other is iOS7 so you get a better idea of the problem.
Although iOS 7 is still in beta phase. But according to current docs, you can check the version and load your components accordingly. See this link ( You need to login to developer portal first ).
if (floor(NSFoundationVersionNumber) <= NSFoundationVersionNumber_iOS_6_1) {
// Load resources for iOS 6.1 or earlier
} else {
// Load resources for iOS 7 or later
}

Keyboard shows then immediately hides itself when showing MFMessageComposeViewController

I am building a PhoneGap app using Cordova 2.2 for IOS. I am experiencing some bizarre behavior when calling out to a native obj-c plugin I have written to show the MFMessageComposeViewController.
The setup is very simple - I have a tap event attached to a UI element, that when pressed, will make a call to my PhoneGap plugin, pass with it a number and a text message, then show the MFMessageComposeViewController with the parameters pre-populated.
My javascript looks like this:
$(document).bind('deviceready', function(){
$(".theButton").tap(function(){
cordova.exec(function(){}, function() {}, "PhoneGapSms", "SendSms", [db.getItem("profile_sms"), db.getItem("profile_emergency")]);
});
});
And my obj-c code looks like this:
- (void)SendSms:(CDVInvokedUrlCommand*)command
{
CDVInvokedUrlCommand* myCommand = command;
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
NSString* body = [command.arguments objectAtIndex:0];
NSString* toRecipientsString = [command.arguments objectAtIndex:1];
if(body != nil)
picker.body = body;
if(toRecipientsString != nil)
[picker setRecipients:[ toRecipientsString componentsSeparatedByString:#","]];
picker.messageComposeDelegate = self;
[self.viewController presentModalViewController:picker animated:YES];
[[UIApplication sharedApplication] setStatusBarHidden:YES];
[picker release];
}
So, all in all, very simple stuff.
My Problem is this:
When my iPhone is plugged into my Mac and the app is run from XCode, the Message Composer overlay appears great, with my values pre-populated. Image below demonstrating the SMS interface appears fine while plugged into XCode:
When my iPhone is unplugged from my Mac, and the app is run from the spring board, the Overlay slides up, the keyboard begins to slide up, then immediately slides down - making it impossible to type or send the message. This is what it looks like when not attached to the Mac/Xcode - the keyboard begins to slide up then immediately slides down (~ < 1 sec) leaving the following interface:
I can't for the life of me figure out what would cause the keyboard to hide when not running from XCode, but work perfectly well when it is.
Is there any way to 'force' the keyboard to display, or possibly put the whole modalviewcontroller as first responder in some form or fashion?
Any suggestions are appreciated!
Edit:
The keyboard WILL appear again if you click in the contact area
You must add MessageUI.framework to your Xcode project and include a
#import <MessageUI/MessageUI.h> in your header file.
try this code may be its helpful to you..
[self presentModalViewController:picker animated:YES];
//[self becomeFirstResponder];//try picker also instead of self
Also Refer this bellow tutorial and also check demo..
new-tutorial-developing-and-architecting-a-phonegap-application
SMSComposer
i hope this help you...
I encountered these symptoms with a Sencha Touch 2.2 and Cordova 2.6.0 setup (specifically, iOS 6+ devices).
The issue was with the web framework stealing focus away from the native SMS Composer modal, typically occurring after the first SMS Composer modal had been successfully displayed and closed.
A event.preventDefault() and event.stopPropagation() call once the event had been fired (or event.stopEvent() in Sencha land) resolved this.
Hope this helps,
-James
First: The most likely culprit, without seeing your code, is that your parent (presenting) view controller may have an action in its viewWillDisappear or viewDidDisappear that is affecting who has the "first" responder. These methods get called when presenting a view controller modally. It may be behaving differently on the simulator than the device due to timing - often really close timing conditions are different on the ARM device and the i386 processor.
Second: Does anywhere in your app register for the UIKeyboardWillShowNotification or the UIKeyboardDidShowNotification? If so, put breakpoints in the methods that are called as a result - it's possible some other controller in your view hierarchy is interfering with this one.
To answer your question...
Is there any way to 'force' the keyboard to display, or possibly put the whole modalviewcontroller as first responder in some form or fashion?
No to both. The only way to make the keyboard display is to call the becomeFirstResponder method of the input view. Since Apple doesn't expose the text view, you cannot send it messages. Setting the modalViewController as first responder would be setting the wrong object.
I found the same type of issue But Not Sure it will Solve your problem or not Just Have a Look on the Following Links :
1. http://community.phonegap.com/nitobi/topics/keyboard_is_not_triggerd_in_my_ios_build
2. https://github.com/phonegap/build/issues/31
If its not Solving your issue then you can Download the Sample code Here.
Link: https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/SMSComposer

Popover resizing broken in iOS 5.1

I have a popover in an app and it doesn't resize to what I set. I found this but it still doesn't work in iOS 5.1. I switched to the ios 5.0 simulator and it worked again. Am I missing something?
EDIT
In viewDidLoad:
self.contentSizeForViewInPopover = CGSizeMake(320.0, 137.0);
In viewDidAppear:
self.popoverController.popoverContentSize = CGSizeMake(320.0, 137.0);
Looks like it has to be a "bug" or a change in iOS 5.1. Apple's sample code does not do a popover in a splitview. I have disabled the swipe gesture though by calling setPresentsWithGesture on the splitViewController. It is annoying swiping and having the master view come up.

2 XIB and 1 viewcontroller but functions don't work in the ipad XIB

I believe that I did everything necessary to change my app for ipad (was for iphone at start). I can toggle the build status to either iphone (only), ipad (only) or iphone/ipad - and the app launches either in ipad or iphone simulator. I can do that forth and back at will.
I added the idiom to check for ipad and basically for one of my xib, instead of using the string of my xib to create the controller, I use the one for the ipad. So it is a new xib for ipad with all same graphical objects ( enlarged ;-) ) . I added the callbacks to function correctly with IB.
I can see everything fine and arrive on my new ipad view BUT when I click on one of my buttons... nothing happened like if my callbacks don't work. It is very surprising and actually I have no idea where to look as I compared most of the parameters between my iphone and ipad view and they are identical as far as I can see.
It must be something damn obvious so if one of you had the same issue and it was a very simple answer ... I guess that would be what I missed!
Thanks for your help in advance
Cheers,
geebee
EDIT1: Some code as requested
at start I have that to decide either way:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
examTFVC_NIB=#"ExamTFViewController-iPad";
}
else
{
examTFVC_NIB=#"ExamTFViewController";
}
Then to go to the right view:
ExamTFViewController *examTFViewController = [[ExamTFViewController alloc]
initWithNibName:globals.examTFVC_NIB bundle:nil];
But I have no problem loading the correct XIB. The issue is really the callback functions not being called...
Thanks for the help.
EDIT2:
I also realised that calling the extension of the xib xxx~ipad allows to avoid the example code above. And it works - but still no function can be called.
EDIT3:
IMPORTANT FINDING: if I move my buttons higher and on the left of the screen: they work! So it seems that the functions are called if the event are in the region of an iphone screen although I am on an ipad screen. I guess know it would be more obvious to find the issue! thanks for any help – geebee just now
ANSWER
iPad touch detected only in 320x480 region
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// to correct region size
CGRect rect = [[UIScreen mainScreen] bounds];
[window setFrame:rect];
// now, display your app
[window addSubview:rootController.view];
[window makeKeyAndVisible];
}
** OR OTHER SOLUTION **
Check the full screen at launch checkbox - only present in the ipad xib MainWindow
finally solved - with 2 methods - programmatically or via IB - in the edited section of the post.