I would insert a UISegmentedControl into UIPopoverController header. How can I do?
Check this link.
UISegmentedControl embedded in a UINavigationBar/Item.
I would replicate a similar behavior.
Thank you!!
EDIT: In particular, the UISegmentedControl is composed by three segments. Each segment displays a different views inside the UiPopoverController.
The answer is in the link you posted yourself. Embed your view controller in a navigation controller and add the segmented control as the title view of your navigation item. The popover controller is smart enough to recognize this and will draw your navigation bar as part of its own header.
Related
I am now developing a modal view presented on UINavigationController.
I tried to blur the content of UINavigationController's rootViewController under the modal view.
So I set up modalPresentationStyle value as .overFullScreen or .overCurrentContext. But I can't get the right result.(A blurred effect was shown for a second and it was disappeared.)
I read Apple's document and found that there is .blurOverFullScreen configuration on it.
But I can't use it on my environment(Xcode 10.1).
Please help me how I should solve this issue.
Thanks.
This is what I want to do but not sure if it could be done.
my first view contains 3 buttons.
When this view is displayed, I need to present a ModalPopup for the login.
When the authenfication is done, the user can tap on one of the 3 buttons.
When the button is taped, I need to switch this view to a TabBarController and active the correct TabBarItem regarding the button.
Most of the TabBarItems can contain a SplitViewController.
I read several posts and tutorial about the SplitViewController but most of them show how to run a splitViewController from the appDelegate controller.
Then my first question would be.. is it possible :-)
The second one, would be, how?
Thanks...
Mortoc is correct about UISplitViewController needing to be the root controller.
You can use MGSplitViewController as a drop-in replacement for UISplitViewController - and it doesn't have this limitation.
It sounds as if your hierarchy might be something like
UINavigationController (root)
UIViewController (3 buttons)
UITabBarController
MGSplitViewController (1)
MGSplitViewController (n)
Sorry, you'll have to roll your own SplitViewController equivalent. Apple only supports UISplitViewController as the root view item: it has to be the first view loaded in your application and it's size is fixed.
http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/iPadControllers/iPadControllers.html
any advice welcome! :)
My screen design is landscape with text on the left (this is in the main view) and a scrollview on the right (which contains an interactive map image)
The mainviewcontroller contains the scrollview as an outlet.
In the scrollviewcontroller I add a 'map' view into the scrollview.
In the mapviewcontroller I update an array in the appdelegate, depending on the user input.
I would now like to refresh the main uiview that contains the scrollview to display the updated text from the appdel array - whenever the user clicks a button.
You should call your view's -(void)setNeedsDisplay method to cause it to redraw.
[myView setNeedsDisplay];
See Apple's reference documentation here: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIView_Class/UIView/UIView.html%23//apple_ref/doc/uid/TP40006816-CH3-BBCCADHC
You have to call viewWillAppear from the other viewcontroller
How can I arrange (programatically) the back button of a UINavigationController in a different position?
For example, suppose that the back button (visible in the upper bar of a UINavigationController) has these coordinates: 67 for x and 10 for y. I would arrange the back button for these coordinates: 89 for x and 10 for y.
Do I have to override these measures in a specific method (for example viewDidLoad() method)?
Thank you. Regards.
I guess this cannot be done in a simple way as you can manipulate the navigation bar only via few properties. So there are basically two methods:
1) traverse the UI tree and search for the actual button control created by iOS for you in the navigation toolbar and change its Frame property. You can always get to the inner controls by the Subviews property, so call navigationController.Subviews and iterate through that until you find the control you would like to move, btw it could be deep in the hierarchy, depends. And with iOS update this can change, so this is a bit of a hack, but usually such technique works well.
2) do the custom way. Hide the actual navigation bar, and do the navigation yourself via custom buttons, add a UIButton to your interface, in the action for that call popViewController on the navigationController. If you're inside a view controller, you can use this.navigationController.PopViewControllerAnimated (...);
If you need nice buttons, use this PSD, works well for me http://www.teehanlax.com/blog/2010/06/14/iphone-gui-psd-v4/
Hope this helps. If so, please vote.
I have a simple maps app with multiple pins on a map view. My intention is to tap a pin, show a callout with an accessory view, push to a Detail View Controller where you can edit that pin/locations details. This all works fine, but once i pop the Detail View Controller the callout on the map view is still there, which i want, but it still has the old uneditied values. How can i refresh/update the callout view once the Detail View Controller is popped?
I am using Core Data with a simple database. I have tried using controllerdidchangecontent, Map View Controller Will Display methods etc but my main problem is identifying which object has been added/updated/deleted and which is the corresponding callout/selected pin.
Any help appreciated...
Not sure if you had find your answer but the way to do it is to extend MKAnnotation class and creating custom annotation and passing them while creating placemarks. Later you can get them from MKAnnotationView's annotation property.
See a good implementation here
http://www.slideshare.net/360conferences/getting-oriented-with-mapkit-everything-you-need-to-get-started-with-the-new-mapping-framework
The only way I could find to update the callout info was to mess directly with the subviews of the callout.
The callout view is the first subview of the annotation view.
In the following example, I update the subtitle.The title label is the 6th and the subtitle is the 7th subview of the callout:
if (myAnnotationView.subviews.count > 0)
((UILabel*)[((UIView*)[myAnnotationView.subviews objectAtIndex:0]).subviews objectAtIndex:7]).text = #"Some example";