UiViewcontroller with Button - ios4

I have 2 viewcontroller and in that one controller having a button, now i want when i pressed the button it will show the next viewcontroller without using navigation and modalviewcontrollers...
How can i do this plz help me....

If you want to present a controller's view without using navigation or modal view controller, you can simply add the controller's view as a subview of the window.
In the controller that will present the next controller you would do the following:
[self.view.window addSubview:controller.view];
EDIT: Try the following:
[((YourAppDelegate *)[UIApplication sharedApplication].delegate).window addSubview:controller.view]
This assumes that your app delegate has a window property.
EDIT 2: Here's another option.
[[UIApplication sharedApplication].keyWindow addSubview:controller.view];

Related

Why no back button on DateElement picker?

This walkthrough for MT.D shows a back button on the UIDatePicker that appears when a DateElement is tapped. I'm in an iPad app, and using an MT.D DialogViewController as a subview in an overall UIView. When the date picker slides up I just get the black background with no way to dismiss the picker (no nav bar w/ back button). Same problem exists for the radio group picker. Is this because the dialog view controller is being used as a subview? Any ideas how I might get a nav bar up with a back button using the built-in picker logic?
You must use the DialogViewController as a child element of a UINavigationController to get the back button. On iPad, you can embed the UINavigationController in a UIPopoverController.
Adding the view of a controller into the view of another controller is not considered good design on iOS and won't result in the behavior you expect.

MonoTouch Dialog add a toolbar at the bottom of the dialog

I am trying to add a Toolbar that is anchored to the bottom of a MonoTouch Dialog.
Here is an example:
So as you scroll, the table's contents scroll but the toolbar at the bottom remains in view always. I know how to do this by using the interface builder, but no clue as to how to do this with Mt.D. Please please tell me it can be done!
To do this, it's probably easiest to use the DialogViewController and its View as a child of another UIViewController.
Just create your public class MyViewController : UIViewController class and then create and size your child views in the override ViewDidLoad method.

ScrollView with paging iphone sdk

in the main view controller i have a scrollview and paging control.
i have added another viewcontroller's view as a page of paging control in scrollview.
now i have 9 buttons on that view controller's view which is inside scroll view.
now when i click on the buton i wants that main view controller's view should be pushed to another view controller.
but not getting how it can be done as the buttons are in view which is in the scrollview.
When a user interface element created in interface builder seems not to be doing what you told it to do, you should verify that:
you saved your changes to the nib in IB
that you correctly declared your ivars/properties as IBOutlet and connected your outlets in IB
that there are no views hijacking your events.
If the buttons in your view inside the scroll view don't appear to be getting press events, you may need to adjust the userInteractionEnabled property of parent views.
You can "move" any view from one view hierarchy to another by doing:
[myView removeFromSuperview];
[anotherParentView addSubview:myView];

How do i refresh a tableview after returning from Background

How do I refresh a tableview after returning from Background(when the user hit home button and comes back later). Its not calling the viewWillApper delegate method.
Thanks,
Shinto.
Override applicationDidBecomeActive or applicationWillEnterForeground in the appDelegate. Then I would either call the table view controller to reload or use a NSNotification.
Note: applicationDidBecomeActive is also called when the app launches. See: Understanding iOS 4 Backgrounding and Delegate Messaging
u can do it in the Home Button. First Get the ViewController thats hold the TableView and do further action...

How to add Normal viewcontroller after navigation controller in windows based application?

In my windows based applicaton, after login screen and registration page I added navigation controller for next two views. After pressing button present on second navigation window,again i want normal view controller and not navigation. But Its giving me navigation window with back button which takes me to second navigation window.
Can anyone plz tell me the solution??
You have a couple choices: you can truly eliminate the Navigation Controller entirely and replace it with another UIViewController (more complicated), or you can just push a new UIViewController that will not have a navigation bar/back button, and use that as the effective "root" view controller of your application from there on out. Without the navigation bar, your view controller will look like a "normal" view controller.
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationController.navigationBar.hidden = YES;
...
}

Resources