UICollectionView in UITabBar display wrong position on first load - ios

I have been stuck at this for days. The problem is that the collection view that is in a tab bar after its first load. It will be display incorrectly. If I press any tab the problem will disappear forever until the app is restarted. Note that it's not just a white space that appearing. The whole container is getting shift down so the white space appear.
This problem only seem to exists on the iPhone and not the simulator. Tried it with iPhone 4 and 5.
After a second try I think it only happens in iOS 7 and not iOS 8
Can confirm that it only happens on iOS 7. Upgraded one iPhone 5 to iOS 8 and the bug is gone while another iPhone 5 is still iOS 7 and the problem appears every time.
See the white space below?
It disappear after I press another tab
It doesn't even come back if I go back to the original one
I uploaded an example project with this problem here: https://github.com/athiwatc/UITabBarDisplayWrongPosition

Change the constraints as in the following screen shot:

Related

Navigation controller causing auto-layout issues on screens in Xcode 8

This has happened on a couple of apps I've been working on, and I believe it has something to do with Navigation bars or Tab bars. I'll work on another screen and be messing with the code and then I'll randomly scroll across the Storyboard and see that all the constraints have suddenly changed values and some items have expanded to 1000 x 1000.
Has anyone experienced this before, and know what is causing it? It's happened quite a few times to me now and it's obviously annoying to reset them each time.
Since you updated your Xcode to 8, you may need to update frames in the whole scene (once).
If you do that each time and it doesn't help, for me changing size of the storyboard helped. For example change from iPhone SE to iPhone 6 and vice-versa.
Now in Xcode 8.1 Beta version, there is a shortcut button for this.
Just select the problematic view's superview (containing mentioned constraints), and click this update frames button:

Screen Shift on UIInterfaceOrientationLandscapeRight

I've got this application mainly displaying photographs.
The app was originally written for iOS 3.1 and upgraded to 4 before beeing published. It was not touched ever since. Now that the owner of the API appied some changes which ain't as compatible as they thought, I am forced to update the app. So I'll have to go for iPhone 5 and 6 and 6+ and iOS 7 and 8 updates in one go.
I observe this behaviour in the simulator of iphone 4, 5 and 6+ dimensions.
Portrait looks fine.
Landscape left looks fine too.
Landscape right is screwed up. Apparently it looks as if the whole screen were shifted to the left.
This is strange because I am not aware of anything that I would do different for landscape right or left. All I am doing is differnicating between any portrait and any landscape orientation.
It worked fine in the old version. But frankly I cannot reproduce this any more because I don't have access to the old xcode and sdk versions. But the app is in store for years and works fine on modern devices and modern OS versions.
A bit more background info, just in case it is of importance:
The app is based on a UITabBar, but it is not visible in this view.
The image is scrollable. It is placed on one view three times of the size of the screen with preceeding and succeeding image views place to the left and right respectively. This view with the three images is placed within a scroll view of the size of the screen or window respectively. This concept still works file, it is just shifted.
When I check the view item's frames in debugger or with NSLog, they all seem to be right, starting at (0.0/0.0) or respectively.
The view on the bottom with the four buttons that navigate to related functions and their view controllers, is re-alligned programmatically on each rotation, as well as the overlays with the textual information. All works as it should but it's shifted in this one orientation.
Well, all views are layouted programmatically on each rotation.
There are no constraints defined.
iOS6/7 deltas are all set to 0.
The app "wants fullscreen". By tapping on the image all UI items disappear and re-appear on the next tab. (Just by setting the .hidden attribute. Except for the navigation bar. Thats managed using setNavigationBarHidden:animated: with YES on animated) Works fine, even in the shifted view.
I am running out of ideas.
While I put all the details together for the question, eventually one idea came to my rescue.
The issue is related to hiding the tab bar. I could not use the regular way of hiding the tab bar because then it would not re-appear when navigating down to the functions that are associated with the buttons on the bottom overlay view.
Therefore I did some sort of hack. I did not hide it regularily but moved the tab bar out of the screen.
AND: This was the only thing that I did differently for landscape right and landscape left. I just searched for the constant names and found it.
Apparently, manipulating the tab bar view had a flaw in older iOS versions. (Or in older SDK versions, I am still working on that important detail)
To overcome the flaw the tab bar view was modified this way for landscape right:
[self.tabBarController.view setFrame:CGRectMake(0-kTabBarHeight,0,width+kTabBarHeight,height)];
This does not seem to make sense but did help me out a lot on similar issues years ago when the app was written.
Now, I changed this to:
[self.tabBarController.view setFrame:CGRectMake(0,0,width+kTabBarHeight,height)];
which is the same for landscape left too.
For the time beeing I separate between iOS versions >= 8.0 and smaller. But I'll double check that with older devices and may get back to this answer later.
I leave the question posted because I found the original "hack" here on SO too, so that I guess that others will have the same issues when updating to ios 8 or SDK 8 respectively.
Thanks for listening.

Xamarin iOS iPhone 6 Plus Not Filling Entire Screen

I have a default existing project in Xamarin.Forms version 1.2.3 and I have the same issue as reported here hinting that auto-layouts should be used.
When I start the iPhone 6 Plus app, there is about 1cm black bar at the top and bottom of the page, with even the task notification bar at the top moved to the smaller size screen displayed when launching.
Its probably a one liner change but what and where does this need to be done?
I'm rather surprised this is not in the default template already however.

iPhone 5 storyboard still shows padding when running on iPhone 5

I have made a new app with storyboard, where the storyboard is currently just for iPhone 5. But the issue is, when I run this on iPhone 5 device/simulator, it shows padding at the top and bottom of the screen as if an iPhone 4 application is being run. Please see the screenshot I have attached. And help where did I go wrong.
EDIT : Actually its still not working. In iOS 8 its coming fullscreen but in iOS 7 for some reason the black padding is coming. PLease hellpppp.
EDIT - I got the issue.Apparently, in xcode 6, when Launchscreen.xib is given, it does not work for ios 7 and it works perfectly normal for ios8.
Previous answer - The issue was, in Xcode 6.0, the new project generates a LaunchScreen.xib file, but apparently you manually have to go to the General settings for the target and select the launch screen File options from the drop down. This solves the issues. :)

Black bar on IOS 7

I have an iPad app. When I used it in iOS 5 or 6 its working fine and the UI also seems to be fine. But the same in iOS 7 a black bar on top, bottom, left and right of the screen appeared. Including on the splash screen.
I had tried it by hiding status bar of all views.But I cant fix the issue.
- (BOOL)prefersStatusBarHidden
{
return YES;
}
Can any one know what is the reason?
The same thing happened to me as a result of downloading the latest version of Xcode
and all I had to do was adjust the frame of my view as it was altered during the download. It's so simple I didn't even think to try it.
How big are the bars? Is there any chance this is actually an iPhone retina app and this is iOS 7's new automatic scaling for the iPad's bigger display instead of the old '2x' mode?
Also, does it behave like this in the simulator and if so, can you post simulator shots of it running under iOS 6 and iOS 7?
See here for what I mean : http://www.iphonehacks.com/2013/07/ios-7-uses-retina-assets-of-iphone-only-apps-on-non-retina-ipad.html

Resources