UINavigationController with UITableView in modal popup (on iPad) - uinavigationcontroller

Short Version:
"How do you get a simple UITable drill down UINavigationController-styled non-full-screen modal dialog on the iPad?"
Long version:
I have a very specific set of requirements that I can't seem to get working...
I have a functioning iPad program that that needs to pop up a non-full-screen modal view. This modal needs to have a navigation controller and a simple drill-down table that displays a detailed view that I can have edit some values related to the selected item in the table.
Of course I am looking to have the regular "Back" and "Delete" buttons in the Navigation Bar.
I can handle the detailed view, what I am having issues with:
Non-full-screen popup (mine is
always full screen no matter what I
try).
The Navigation controller will not display the Table View I tell it to and the navigation bar does not even have the title I assigned to it in IB.
I can't seem to get any of this working. If anyone has a step by step example of how to do this, that would be great,
~Eric
P.S. I am not afraid of doing this 100% programmatically, but all the examples I have been trying to follow (and failing at extending to my problem) use IB.

As for the fullscreen issue, you need to set modalPresentationStyle to UIModalPresentationFormSheet or UIModalPresentationPageSheet on the controller you want to present modally. I'm not sure of a way to do this through IB.
As for your navigation controller/table view, I think more information is needed to provide an answer.

Related

Xamarin Forms, Adding items dynamically inside CarouselView on the run, Strange Behaviour

I use the same DataTemplate to populate some of the views inside my CarouselView: a XAML file with a ContentView. I assign a custom class list to ItemsSource of the carouselview AND use bindings inside the template layout fields to fill them with the properties of my custom class. Everything is working fine. Here comes the wierd part: Let's say there's a button in the template and when you click it on the screen, a Label with "Well Done" text is added to the current Stacklayout of the shown carouselview. This is done by the codebehind of my template XAML. This is ok, too, but I expect this "Well Done" to disappear after I swipe back and forth enough. Because it's not part of the template. It does not disappear, instead I see it on other carousels once in every 4 swipes and it is replaced, I mean it appears on different carousels if I swipe back and forth. To make it disappear completely I have to swipe away from the views that share the same DataTemplate. I cannot understand the mechanics behind this behaviour. I can create another field inside the template to put the "Well Done" text there and show it when the time comes, I know. But I want to understand the mechanics. Thank you.
Asking the right question about a problem is the key to any solution..
After the realization that I've mentioned at the Update comment, I've searched for DataTemplate Caching and found this issue post on Xamarin.Forms Github: https://github.com/xamarin/Xamarin.Forms/issues/9200
There you can find an explanation to how CollectionView was designed and understand the mechanics behind the behaviour. No bug. It's by design.

Editing the navigation controller from push segue

So i have a static tableview with 4 rows, i'm connecting them to different viewcontrollers without using any code instead i'm simply dragging the cell and setting up the segue.
The issue i'm having is that when this segue is performed a navigation controller is automatically generated and embed at the top so i get the following result below.
How could i edit the text and the icon? I want to remove the settings text and use my own custom icon.
It's also worth noting that i have embed other navigation controllers throughout my app. So i'd like to target this view specifically rather than all of my views.
I suspect the accepted answer on this question may help: how to replace/customize back button image in storyboard navigationcontroller
You'll need to do it in your prepareForSegue I believe.

Swipe to go back in navigation controller on iOS 7

I've been looking through the iOS 7 / UIKIT framework, and although it looks quite different aesthetically it's really the same SDK underneath from what I can see.
My question, is there any extra code that needs to be included to get the draggable behaviour between pushed tableviews/views?
When you push a view onto a UINavigationController you can now drag back to the previous controller from the side rather than pressing the back button.
This behavior can be seen in mail.
How is this achieved, do I need to add any code to add it to my app?
This has nothing to do with UITableView or UITableViewController, but with UINavigationController. And yes, you get this behavior for free as long as the back button is visible.

Disable UIPageViewController when ModalViewController opened

I am totaly new to this site, but I already like it :-)
I found it by searching for a question about the UIPageViewController.
I have a normal UIPageViewController App, in which I open a ModalViewController for setting up some settings...
Now the Problem: :-)
If I click on the done Button on the right side of the ModalView, to dismiss it, the PageViewController turnes the page, because he thinks that he is meant by that click ;-)
Can I disable the PageViewController GestureRecognizer as long as I have a ModalView opened?
Is there a method to disable and later his recognizer?
thank you for your help in advance...
cu Matze
It seems odd that your UIPageViewController would steal touches from a modal view presented over it. Unless, perhaps, you are embedding the modal view within the content of the UIPageViewController?
To answer your question -- you can easily disable the page view controller's gesture recognizers by enumerating its gestureRecognizers property (an NSArray):
for (UIGestureRecognizer *gr in [self.pageViewController gestureRecognizers]) {
[gr setEnabled:NO];
}
Re-enable them later with setEnabled:YES.
UPDATE:
In iOS 6 UIPageViewControllerTransitionStyleScroll has been added. UIPageViewControllers that use this transition style return no gesture recognisers in the array returned by gestureRecognizers. Presumably page view controllers with this transition style use an underlying, private UIScrollView instance (it behaves just like a UIScrollView with paging enabled), although I haven't checked this.

Navigation issue in Flex - ViewStack, states or something else?

I have a bit of doubt regarding my application which is being created using Mate framework. The first thing user has to do is to log in, so I created Login.mxml view. After a successful login I need to display the main view with applicationControlBar at the top and a workspace below. At the moment I have two separate views, so if I understand correctly it makes sense using ViewStack.
Thing is, I'd like also to display some kind of panel with buttons on top of the workspace after login - here is screenshot. After clicking on a button the panel should dissapear. To complicate things a little bit more, there is a possibility for this panel to change state. Clicking on a specific button may result in showing progress bar at the bottom of panel.
I feel I should create separate view, MenuDialog.mxml and put there buttons, progress bar and states, but how to display it on the top of the workspace? I hope my problem is clear enough :)
I would make the panel a popUp, with the main application (or the ViewStack's parent container) as the parent of the popUp. You can use the PopUpManager Class to close it based on user actions within the Panel.
Assuming that perhaps you do not want a modal login style panel (which many apps these days eschew) then you should absolutely use states rather than ViewStacks.
States are a much cleaner way to distinguish the various, uh, states that your UI can be in -LOGGED_IN, LOGGED_OUT, etc.
It may take a little to get used to working with states, but once you do, you'll never go back. :-)

Resources