I am building an ios application for iPad, I used uitabbar to show some uiviewcontrollers, I added in some of these uiviewcontrollers an uitableview. Now when I first load the application the uitableview appears and show my data. if I opened an uiviewcontroller that is not in the uitabbar and return to the tab bar the table disappears !!! then if I choose another tab from uitabbar tabs and return to my tab (the one which has the uitable that disappears) the table show up !!! anyone know how can I fix this problem ?
I think it is an Storyboard/layout issue !!
any help will be appreciated, thanks
Sounds to me like you are doing some kind of initialization in viewDidLoad which is not called again when you come back from a child view controller.
One quick fix could be to move that code to viewDidAppear method. If you further want to understand when either of this method was called or not, you could throw in some NSLog statements in each.
Related
I have a class (movieTable.m) with TableView populated with many cells.
As i Clicked one of them, the navigation controller brings in the other scene done in the StoryBoard.
When i get back, still with Navigation Controller, i find the TableView moved little bit down.
As I debugged the Hierarcy i found that UITableViewWrapperView is scrolled down from UITableView.
Edit: The funny thing is: if i put a UiSegmentedControl in the UiView the issue disappears.
Why this? i didn't tell the code to move it. Maybe I'm getting wrong with the timing?
so to making clear the ideas, there's two images:
Hierarchy before/after changing the scene
The Code if you want to see it is in this following GitHub: GitHub
Thank you all for helping&hints.
this worked for me
add
self.automaticallyAdjustsScrollViewInsets = NO;
to your viewDidLoad of the moveiTable.m
I am using iOS 8 storyboard with auto layouts. I have objects that are hidden UIViews to start and end up being visible. Whenever I go pick a video from my UIImagePicker and come back, all the objects turn hidden again almost like the UIViewController is being reloaded. How can I fix this? How do I stop the UIViewController from auto reloading every time another controller is shown like in this case a UIImagePicker.
Do you perform any view related show/hide inside viewWill/DidAppear/Disappear or viewDid/WillLayoutSubviews?
I have a tab bar with 5 tabs and each tab has a view associated with it added in storyboard. In my third tab , I have a view associated with "Inbox Table View Controller". When I run the application and click on third tab, only the table appears with no data in it. But when I navigate to some other tab and click on third tab once again , then the data appears. What could be the problem here?
Sorry for the late reply. I also got stuck with this kind of issue recently. If you are still searching for the answer, try this.
There are some common errors that occur while working with the tableviews. I think you are stuck with one of those . Try to use [self.tablview reloadData] in your viewDidLoad method of the controller. It may work.
PS: Just a wild guess as you have not posted your code.
In my storyboard I have two navigation controllers, say A and B. I bring NavB as a modal controller when a button is clicked on NavA. I have a textfield in my NavB. I have connected this textfield to the controller from storyboard and also have set the textfield delegate. When I click on this textfield, my view automatically animates up. I did some research and found that this happens when I set the delegate for textfield. This dont happen when I push my controller.
I have no clue how to fix it.
Please help!
I believe your viewController is UITableViewContoller, no?
The autoscroll-behavior is located in the UITableViewController functionality. To disable the automatic scrolling there are two ways:
use instead of the UITableViewController simply a UIViewController - set the datasource and delegate on your own.
Override the viewWillAppear-Routine - and DONĀ“T call [super viewWillAppear: animated].
Hope this fixes your issue, cheers :)
I would like to just make sure that your view is not a class of TPKeyboardAvoiding. Since its description says that:
A drop-in universal solution for moving text fields out of the way
of the keyboard in iOS
I have used in the login/sign controllers and observed that when a UITextField goes in edit mode, the TextField goes out of the way and view scrolls accordingly.
I fixed the issue. I had unticked 'Under top bars' in the storyboard and thats why i was getting this behaviour.
I'm working on a new app where there is a "main" UIViewController with some UIButtons and once the user clicks on the buttons, the application is navigating to another UIViewController.
For some reason, the UIViewControllers are not opened, when you click on the button nothing happens. Several points that anyone who tries to help should be aware of
I'm using code and interface that are very similar to another app that I had created and is working fine (I triple checked the code, and it's the same in the area that makes the UIViewControllers navigation)
I triple checked the Interface Builder items and their connection to the IBOutlet us fine (view is connected to view, File's Owner is set correctly, etc...)
I inserted NSLogs to the UIViewController that is not being pushed and I can see that initWithNibName is being called, but viewDidLoad is not being called.
I'm using basic-simple code to create and push the UIViewController: alloc+initWithNibName and then presentModalViewController or pushViewController (none of them work) and as I said, in another app with the same mechanism it works fine.
I don't know where to look! Maybe I unchecked by mistake some "Enable" button in Interface Builder or something like that.
Did anyone encounter something like that or may have some new thought regarding to where I should be looking?
Hmm, strange. Things i can come up with now are: dit you call [super ] in your viewDidLoad?
Is it stacked behind another view? Run instruments to see if all the things on the pushed view are allocated, so you know if the whole view is loaded. And you use a navigation controller? than you use pushViewController. When you are not and want a model you use presentmodalviewcontroller.