MWPhotoBrowser iOS 7 weird positioning - iphone

in iOS 7 the MWPhotoBrowser is using weird coordinates for the first displayed image. I looked into the code but I don't get it.
In iOS 6 it is only possible to drag/swipe the images in the browser horizontally, but in iOS 7 its movable into any direction.
Maybe someone has an idea on this.
#see: https://github.com/mwaterfall/MWPhotoBrowser/issues/126

As commented on https://github.com/mwaterfall/MWPhotoBrowser/issues/126#issuecomment-24834650
you need to add
if ([self respondsToSelector:#selector(automaticallyAdjustsScrollViewInsets)]){
self.automaticallyAdjustsScrollViewInsets = NO;
}
to the viewDidLoad of the MWPhotoBrowser.

Related

Scroll view doesn't visible when i am using removeFromSuperview in xcode 5 (ios 6.1 simulator)

I am using xcode 5. when i was run app from xcode 5 for ios 6.1 simulator then scroll view doesn' see. for ios 7.0 simulator .Before it was working. I am using interface builder
You can see in following image.....
In ios 7.0 simulator it is working
In ios 6.1 simulator It is Totally white
![It is totally White][2]
In my scroll view view controller in viewDidLoad method i have write below code
[scrollView removeFromSuperview];
[self.view addSubview:scrollView];
When I comment above code then scrollview is visible For ios 6.1 simulator
![enter image description here][3]
Seriously I dont know what is the actual reason? is that above reason or not. In xcode 4.6 it was working .Also my app is live on appstore . Please help me .
Thanks in advance
Seems that You have issue with memory management or with position/size of scrollView. Try to set breakpoint and check what heppends with Your object.
#Kalpesh its simply because removeFromSuperview doesn't work in iOS 7. So your scrollView was not removed (if you had touched the screen it would have crashed). But [scrollView removeFromSuperView]; removed the scrollView in iOS 6 .

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
}

Using EGOPhotoViewController with iPhone 5

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.

App not running in ios 5

Since i want the app to run in both ios 5 as well as in ios 6 ,I am trying to run the app in ios 5 which is working perfectly in ios 6 as i have used the autolayout feature but when i use to run the app in ios 5 it crashes since autolayout feature is not available in previous versions of ios .Is there any solution to fix out my problem ?
Answer will be appreciated.
If you want to run your app in iOS 5 then you have to turn off the Autolayout feature.
You can do that from Interface builder.
For more help you can refer this.
You Need to unCheck the Auto Layout.
And make sure you are changing here also.. select ios 5.1
You have to use AutoResizing mask for your view instead of autolayouts since autolayouts are supported iOS 6 onwards.Check the example below
If you are using iOS 6 or later , then u can create a separate xib for the iphone 5 called Retina 4 Full screen. You need to check this in your ViewController Size. Also to check for for both of these xib's . That means to run either of your xib's in iphone 5 or lower versions use these conditions whether in the AppDelegate or wherever you need to show another ViewController.
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
}
else if(result.height == 568)
{
}
the above code would check for the size of your iphone's screen and accordingly adjust.
Hope this has cleared your issues :).
PS:- Dont forget to add your iphone 5 splash screen i.e Default-568h#2x.png.

Button with background image - iPhone 5 resize issue

I have been looking everywhere on here and Google, but I still have this weird issue that I can't figure. I have an app pictures below, with 4 UIButtons that have a background image applied:
When I resize/run on the iPhone 5, the top button resizes in a very strange way:
How do I get all the UIButtons to resize the same way with the iPhone 5? Is it possible? Do I need to use a different method?
I really hope this is not a duplicate, but I am completely stumped. If I change the UIButtons around in other positions along the UIView, a different one will resize, or strange gap spacing will show up.... I don't understand. Thanks for any help!
EDIT: I am using iOS 6 on Xcode 4.5. I am testing on an iPhone 4S and an iPhone 5. I have AutoLayout checked. If I use Pin (just found it) I can get the UIButton to keep its height.
To clarify my question. I want the UIButtons to resize so they occupy the same percentage of the screen.... I want the proportions to be the same, instead of simply adding a bunch of empty space. I hope that make it more clear
One of the features you can use is called AutoLayout. Its provided with Xcode to make it easier adjusting things for the 4 inch screen. You can find a good example here: http://www.raywenderlich.com/20881/beginning-auto-layout-part-1-of-2
But as far as I know AutoLayout works only with iOS 6 which makes it "not so useful yet". I have been using a class called UIDevice, source of which can be found here: https://github.com/erica/uidevice-extension and check if the platform type is iPhone 5. I have it set up in a method which setups GUI when the view loads. Example of my implementation:
UIImage *backgroundImage;
if ([[UIDevice currentDevice] platformType] == UIDevice5iPhone)
{
//I have a 4 inch screen present
myButton.frame = CGRectMake(x, y, w, h); //Set the frame as you would like it to look on the iPhone 5
backgroundImage = [[UIImage alloc] initWithCGImage:[UIImage imageNamed:#"main_background-568h#2x"].CGImage scale:2.0 orientation:UIImageOrientationUp];
}
else
{
//I have a 3.5 inch screen present
myButton.frame = CGRectMake(x, y, w, h); //Set the frame as you would like it to look on the iPhone 3, 3gs, 4, 4s...
backgroundImage = [[UIImage imageNamed:#"main_background"] retain];
}
self.view.backgroundColor = [UIColor colorWithPatternImage:backgroundImage];
[backgroundImage release];
Hope it clears a bit.
you should firstly disable the use AutoLayout this option is under the "Show the file inspector"