Clicking in Xcode 4 emulator is offset! - iphone

I have a navigation bar controller + tab bar controller + UITableview for the first view of my app and within there, everything is fine. But when i click one of the table cells, i do a pushViewController with the navigationcontroller and it shows a view controller (the tab bar and navigation bar still show of course). but only within this view, i need to click about 60 px above my target to trigger the click event. Even for the navigation bar "Back" button, I need to click the very top of the iphone screen to go back.
Has anybody experienced this before!? i have no idea what is wrong

I think this happens when you put buttons directly on a window. I'll stick to keeping everything on views

Related

Navigation bar object in xcode 5 not showing back button and has no functionality

I have been trying to properly setup a navigation bar in one of my View Controllers for an hour now and have not found any working solutions.
I control-clicked on a button on my app's initial view controller(1st VC) and dragged to another view controller(2nd VC) and selected "modal" as the action segue.
I then added a navigation bar item to my 2nd view controller.
When I run my app on my iPhone, I can tap on the button on my app's initial screen and it will take me to my 2nd VC, and the 2nd VC does display the navigation bar, but the navigation bar does not have the default iOS 7 back arrow to let me go back to the app's initial VC.
I was under the impression that this could be setup exactly like I did above and that the back button functionality would be included by default.
Am I completely lost? Do I need to further customize navigation bar programmatically or with a tick box in the attributes inspector? Is "modal" the wrong action segue option?
I basically just want to have navigation bars at the top of a couple of my VC's so that the user can easily get back to the app's initial screen.
Thanks for the help.
Since you are presenting your second screen (2nd VC) as MODAL from your first screen (1st VC), you will not see the back arrow button on navigation bar. Your understanding about back button works for Navigation view controllers (push segue). For MODAL you need to put a cancel button on second VC's Nav bar and put a dismiss action for that.

Navigation to Main Root Controller from Tabbar Controller

I am using storyboard, navigation controller in iPhone application. Then navigate it to another view where I have used Tabbar controller. Then in Tabbar controller, I've 3 tabs and each of them have their separate navigation controllers.
Now, After completed process. But when I navigate to Root, it does back with its own navigation controller inside of Tabbar controller.
Actually, I want to come back on main Navigation Controller of an application where application starts.
Basic Flow :: Main Window -> Navigation Controller -> Tabbar Controller -> Navigation Controller -> Button..
So by clicking on Button -> Back to Main Window... Any Idea to back to main root view.
But I'm stuck with this issue for navigation controller that can't back me to the application root.
Can anyone solve this issue?
Please tell me ASAP.
Thanks in advance.
Not really the answer you're looking for, but FWIW:
You should avoid hiding tab bar controllers inside other controllers so that the tab bar controller appears and disappears. This isn't how they are meant to be used. They're supposed to be a main part of the UI and if I see a tab bar controller I expect it be there at the heart of the UI, controlling access to the main parts of the UI, and visible pretty much all of the time if not all of the time.
Don't take my word for it, listen to Apple:
Appearance and Behavior
A tab bar appears at the bottom edge of the
screen and should be accessible from every location in the app. A tab
bar displays icons and text in tabs, all of which are equal in width
and display a black background by default. When users select a tab,
the tab displays a lighter background (which is known as the selection
indicator image) and its icon receives a blue glow.
Don't be terribly surprised if your app gets bounced from the app store for ignoring the human interface guidelines!
It's resolve with ::
[self.parentViewController.navigationController popToRootViewControllerAnimated:YES];
Enjoy coding..!!

Tab bar disappears after touching cell in tableview

I have an issue with a tab bar app. I am making a tab bar app with three bars on the bottom. On my my first bar it is a tableviewcontroller. When i ckick on the table view controller it takes me to a different view (which doesn't have the tab bar). When I clicked back to the home screen (which has the tab) the tab bar is gone.If you need a picture i will post it!
You may have set your UITableViewController segue to a modal style. If this is the case, you should change it to a push style.
In order for a push to work, your view controller needs to be in a UINavigationController. In your story board, select your root view controller and embed it into a Navigation Controller like this...

UINavigationBar unresponsive after canceling a UITableView search in nav controller in tab bar in a popover

Ok, this is an odd one and I can reproduce it with a new project easily.
Here is the setup:
I have a UISplitViewController. In the left side I have a UITabBarController. In this tab bar controller I have two UINavigationControllers. In the navigation controllers I have UITableViewControllers. These table views have search bars on them.
Ok, what happens with this setup is that if I'm in portrait mode and bring up this view in the popover and I start a search in one of the table views and cancel it, the navigation bar becomes unresponsive. That is, the "back" button as well as the right side button cannot be clicked.
If I do the exact same thing in landscape mode so we are not in a popover, this doesn't happen. The navigation bar stays responsive.
So, the problem only seems to happen inside a popover.
I've also noticed that if I do the search but click on an item in the search results which ends up loading something into the "detail view" of the split view and dismissing the popover, and then come back to the popover and then click the Cancel button for the search, the navigation bar is responsive.
My application is a universal app and uses the same tab bar controller in the iPhone interface and it works there without this issue.
As I mentioned above, I can easily reproduce this with a new project. Here are the steps if you want to try it out yourself:
start new project - split view
create new UITableViewController class (i named TableViewController)
uncomment out the viewDidLoad method as well as the rightBarButtonItem line in viewDidLoad (so we will have an Edit button in the navigation bar)
enter any values you want to return from numberOfSectioinsInTableView and numberOfRowsInSection methods
open MainWindow.xib and do the following:
please note that you will need to be viewing the xib in the middle "view mode" so you can expand the contents of the items
drag a Tab Bar Controller into the xib to replace the Navigation Controller item
drag a Navigation Controller into the xib as another item under the Tab Bar Controller
delete the other two view controllers that are under the Tab Bar Controller (so, now our tab bar has just the one navigation controller on it)
inside the navigation controller, drag in a Table View Controller and use it to replace the View Controller (Root View Controller)
change the class of the new Table View Controller to the class created above (TableViewController for me)
double-click on the Table View under the new Table View Controller to open it up (will be displayed in the tab bar inside the split view controller)
drag a "Search Bar and Search Display" onto the table view
save the xib
run the project in simulator
while in portrait mode, click on the Root List button to bring up popover
notice the Edit button is clickable
click in the Search box - we go into search mode
click the Cancel button to exit search mode
notice the Edit button no longer works
So, can anyone help me figure out why this is happening?
Thanks,
Mark
Ok, got an answer from Apple Developer Technical Support. They investigated it and found it is a bug in the UIPopoverController. He gave me a workaround that kind of works but the right button in the nav bar ends up sliding across the screen after canceling the search. But, at least it fixes the issue. He also suggested I send in a bug report to Apple and I've done that as well. Hopefully they will fix this in the next version of the SDK.
Here's a copy of the relevant portion of the Apple engineer's response:
I've created my own project and dipped into what is going on and it looks like it's a bug in the UIPopoverController where after the UISearchBar is being dismissed, something is being obstructed in the navigation bar.
There's a workaround that I've found for now, though the animation that occurs is not amazingly optimal:
- Use the – searchBarCancelButtonClicked: method of UISearchBarDelegate and add the following:
self.navigationItem.rightBarButtonItem = nil;
self.navigationItem.rightBarButtonItem = self.editButtonItem;
As I said, it looks like the popover is pushing the button onto the navigation bar, so it may not be what you're looking for.
I tried the rightBarItem technique mentioned, but it didn't work for me. I had to do this (which is also a hack really)
[self.navigationController setNavigationBarHidden:YES animated:NO];
[self.navigationController setNavigationBarHidden:NO animated:NO];
This might be because my UINavigationBar isn't one unified with the popover, but I can't say for sure.

iPhone Navigation Problem

I have a tab bar app but the first tab is an image with a button on it. Touching the button is supposed to push a web view. The other tabs are plain web views. Those work fine but every time I push to a new view, it's blank (except for the back button at the top.)
Questions:
Do I need an xib for the pushed web view?
Where does the loadRequest code go exactly? (I used awakeFromNib in the tab bar views)
When I hit the back button, is there a hook or some method I can add to to hide the top nav bar?
First, you never need a .xib for anything; you can always construct your views in code.
Second, what do you mean by "push a web view" and "push to a new view"? You are using a UINavigationController for that page, correct? So you are saying that initially the tab shows the correct page, but when you push a subview onto the stack it comes up blank?
I suspect the place you want loadRequest is in viewDidLoad, but I'd have to see what you are trying to do.
As for hiding the top navigation bar, are you looking for something like this:
self.navigationController.navigationBarHidden = YES;
If so, all you have to do is set that on the page for which you want the navigation bar to be hidden; it has nothing to do with the back button.