This issue does not exist when my app is run on the iPhone, and it also doesn't exist in the simulator, but whenever I run the app on my physical iPad this weird gap shows up between the navigation bar and the top of the table view. It also shows up in a couple other places over the app. The weird thing is there are two table views followed by two regular views that are stacked but the gap only shows up in the second table view and only when you go past it and then come back as opposed to when you first enter it. Additionally, when you begin to swipe back to the previous VC and then let go, the gap fixes itself. I'm not sure what code to include because it feels like more of a glitch than a code issue but I don't know what to do to fix it. I included a video to show what happens.
Video of issue
Related
I started an iOS project for iPhone where I thought might want a tab bar. I later decided that I don't want it (I want the extra screen space) and I so I tried to delete the tab bar and set my main ViewController as the initial viewController in storyboard.
This caused a weird error where the device's orientation no longer adjusts properly. For instance, switching from portrait orientation, shown in the picture:
becomes this in landscape:
If you start the app in landscape, it will look fine, but there will be a similar result when you switch to portrait. The bug manifests in the transition between screen orientations.
I've tried the following:
I restored the tab bar and the problem went away. This problem is caused by how I am removing the tab bar and not some other issue.
I searched for other articles dealing with this issue. So far, I've only seen documentation on how to install a tab bar, not how to safely remove it.
I attempted to connect the tab bar to the viewController with an IBOutlet and then set tabBar.isHidden = true. It's a bad hack, but it didn't work anyway. UITabBar has no such member.
I've tried comparing the settings between the tabBar viewController with my desired initial viewController in the Inspector, to see what may be different. Aside from the initial viewController check-box, I don't see a setting that might be causing this.
QUESTION: Is this a settings issue in storyboard (or elsewhere), or is this just a bug? My next attempt at a solution will be to delete the entire storyboard, and then recreate it and connect it back to the viewController. That's a fair amount of work I'd like to avoid if it's unnecessary.
Any help is appreciated. If I find a solution, I'll make sure to post it. Thanks!
UPDATE: I've found a workaround by going to the UI Tab Bar Controller in the Storyboard, selecting tab bar in Tab Bar Controller Scene -> Tab Bar Controller, and then checking the 'hidden' box in the inspector. This has the desired effect of getting rid of the tab bar when the app is running. It's like it's not there.
While this allows me to proceed with the app, the tab bar stuff is unnecessary code lying around in my app that I would like to get rid of.
Since I originally made this post, I've found out through experimentation that the every time I added Google's GMSMapView to a viewController, programmatically or in storyboard, I was having the above orientation issues. My original problem wasn't what I thought it was
I have since tried completely rebuilding the storyboard, viewController and all, but the problem didn't go away. I also tried overloading the orientation methods for the view to no effect.
However, if you are having this orientation problem with Google Maps sdk, imbedding the view controller that contains your GMSMapView in a tab view controller, and then hiding the tab bar (unless you want a tab bar) fixes the orientation issue in my project. It's not pretty, but it works.
I'm using XlPagerTabStrip for the swipe tabs, everything looks great beside the last tab hiding behind the first tab for the first time while screen is in vertical mode. But after app goes to landscape mode, everything looks good even when app is back to vertical mode.
I'll really appreciate if anyone can guide me towards right direction.
Sorry, the problem was i copied the Button bar view which was causing the problem. later after i use UICollectionView and initialized class as ButtonBarView and module as XLPagerTabStrip, Problem fixed.
I have two views. Upon clicking a button, the other view should be segued onto the screen with a show (previously called push) segue. This works flawlessly, however, for some strange reason when transitioning a short imprint of the previous view is left behind. This seems to be happening only for these 2 views, I can not reproduce it with others, and the bug occurs both on the simulator and an actual device. Here is a GIF of what is happening: https://gyazo.com/662a813de15ba90d6581976f55866289
(Stackoverflow doesn't support direct Gif's in post as far as I'm aware, so sorry for the external link)
Sorry for the low quality.
I simply control-dragged from the "Signup" button to the other screen to create the segue. This seems to be the only transition that is doing this throughout my entire app. This is what it looks like in storyboard. I'm doing nothing programmatically before/after the segue sends.
I've tried programmatically creating the segue as well, however the same effect is occurring. I could not find any similar stackoverflow posts.
Any clues on why this is happening and any possible fixes would be great. If you need more information please let me know.
Edit:
I am not doing anything to resource extensive on the view initialization (I'm simply making the nav bar translucent and modifying a few outlets). I feel it is important to note that the background (The blue) and the sonus logo are both Image Views. I've attempted programmatically setting the background image, however this made no effect on the outcome of the problem.
Go through the below Solution:
Click on "Second View Controller"
Select the top UIView
Now change it's background color to Default
This will solve your problem!
I have a slide out menu in my app, and just to let you know, I'm new to iOS/Swift, so if I don't explain it well, or use the correct terms, that's why.
I use the SWRevealViewController library for my sliding out menu.
The only code i use from that for all my View Controllers is
self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
The issue basically is, when the app first opens, it shows my navigation item's title and all that on ViewController1(default view), but when using the slide out menu to go to ViewController2 or 3, and then going back to the ViewController1, the whole navigation bar/item disappears.
I tried to use something like nav_item.title = "whatever" within viewDidLoad(), but that doesn't work, as far as when i switch back to the first view. The funny thing is, if i programmatically change the title doing that, it changes when it first loads but when i change to View2 and change back to View1, just disappears.
Here are a few images of what i mean, if i didn't explain it well enough, because like i said i'm still new. The development of my app is coming along pretty well because i'm going off my android version i've had done for a while.
Here is when it first loads, title and all. Notice, my background color doesn't overlap or change the top part for the time and battery, which becomes a problem with the later view.
Switched to a different view using my slide out menu.
Switching back to to the original view, the nav item disappears and the background color extends to the full view, overlapping the battery status and time
How does your Storyboard look like? This is how I usually do it.
I have a UISplit-view that uses Table-views in the left hand "Master" area and it seems that after pushing several table-views on the Root Controller, followed by popping them off and all the meanwhile, rotating back and forth between portrait and Landscape, the button in portrait seemed to stop responding.
Upon further investigation, it turned out that it wasn't that it wasn't not-responding, it was that the area that was touch sensitive was sliding partially off the screen making the area that you could touch to get the "Master" popover was at the very Edge of the button making it extremely difficult to hit. I do have a flex space, title, and additional logout button.
Any Ideas?
It turns out that in the Mono-touch split-view template, has two methods in the Detail Controller, in one it hides the popover and button for the Master view while in Landscape, and in the other method it puts it back. I was using one of those methods to add a fexible space item, text item, and logout button to the toolbar. The problem was that because I was doing it in that method, it was adding them every time it went to portrait and somehow the flexible space getting added every time, was slowly pushing the touchable area for the Master Button, off the screen. (The Button itself never moved) After adding the items to the toolbar during the ViewDidLoad method, and not adding it again, resolved the issue.