So i am fairly new to xcode and loving it so far. I am having a problem adding a new transition between 2 views/scenes in xcode
So i have added the new view to my master detail application and would like the transition to be modal and to be form based. I am having a problem getting my head around the 3 areas where you can add/change the transition of the scene.
I am trying to create a transition similar to the one found in the default apple application when you reply/create a new email.
Currently My application when in landscape and correct button is clicked Jumps to portrait mode and displays my new scene for no reason i can see.
My new scene contains a seague,navigation controller and the scene itself. Any help or suggestions will be greatly appreciated.
So finally figured it out after much playing... I changed the seague to style: modal, presentation: Page sheet, Tansition:Default. So working as expected
Related
I have a Notes-like app: uitableviewcontroller showing up individual notes by pushing them onto navigation stack). And I decided to use an ios7 Back button and a pan gesture recognizer coming with it.
My only modification is removing text from the button by setting navigationItem title of the from-controller to an empty string before pushing the detail-view-controller, as it is advised at https://stackoverflow.com/questions/18870128/ios-7-navigation-bar-custom-back-button-without-title
The button itself works just fine, but when I am going back from my note to the notes table view by means of the pan gesture, tableview selection is not cleaned! The row of the note I've just transitioned from is still shown as a selected one.
Any ideas what could be wrong here?
I've checked the standard Notes app and it works like a charm.
This answer did help me: https://stackoverflow.com/questions/897071/iphone-uitableview-cells-stay-selected
- (void) viewWillAppear:(BOOL)animated {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
[super viewWillAppear:animated];
}
At least for the cases we were seeing this happen, it seems to be fixed in iOS 7.0.4. (We've actually noticed that a number of glitches with the back gesture have been fixed during the 7.0.x releases.)
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.
I have a problem that has been solved on iOS6, but still appears if I use the iOS 5.1 simulator.
I have a default page based application. I added a "Main menu" view controller, that has three buttons that activate the root view controller containing the pages via a push segue, all defined in the storyboard.
I then added a navigation controller and made it the initial view controller.
If I pas the menu via a button and flip a few pages I can click the back button and it goes back to the menu. Good.
But I don't want the nav bar, so I hide it, and on the root view controller that contains the page view controllers I add a button which performs this action:
[self.navigationController popToRootViewControllerAnimated:YES];
This button works perfect on iOS6, I can flip a few pages, press the button and I'm back in the menu.
With the iOS 5.1 simulator however (and on my 5.1 iPad), a page flip occurs! It's a page filp until I'm on the last page and then I go back to the menu.
I searched for over two hours now but could not find a solution, I hope someone can help me with this?
Note: setting animated to NO does not solve the problem.
I did find the answer to my question, this is my first iOS project which explains why I did not find it any sooner myself.
In the default page based application there are two lines in the viewDidLoad method:
// Add the page view controller's gesture recognizers to the book view controller's view so that the gestures are started more easily
self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;
First, it's not really adding but assigning that happens here, second, when I put the second line in comment, everything works as expected.
So I'm glad it solves my problem, however it raises some questions:
The gestures are started as easy as they were, so why was this line needed in the first place, what does it supposedly fix?
Why does it work in iOS6? It should have had the same problem, no?
Is it correct that it is an assignment and not an addition?
Any answers to these three are still appreciated.
Alex
In my Qt symbian app, I have over ride the negative exit button with back to come back on main screen and then again over ride it with exit to close the app, my app is working fine on emulator but when I test it on device it shows exit button instead of back, some time it shows back also but if I go to the same page twice then again it start showing exit button, frustrating part is that app is working fine on Qt emulator but not on device. Does somebody knows whats the problem is. I am using
back->setSoftKeyRole(QAction::NegativeSoftKey);
this->addAction(back);
to over ride the exit button before loading the screen and
back->setSoftKeyRole(QAction::NegativeSoftKey);
this->removeAction(back);
to removing back button when coming back to mainWindow.
Create vertical layout and Widget which You will add on scrollarea with parent as that class this e.g
QVBoxLayout *vlay = new QVBoxLayout(this);
QWidget *area = new QWidget(this)
And add widget to it
This will make it child of parent class.
works fine for me.
I think adding and removing QAction objects here and there is asking for problems.
You should try to redesign your application to use a QStateMachine to handle transitions between states.
Take a look at the introductory documentation here.
Refer this LINK for custom softkeys..
QAction* myAction= new QAction(tr("My Action"), this);
myAction->setSoftKeyRole(QAction::NegativeSoftKey);
addAction(myAction);
So I'm working through the code in this tutorial which has a small button labeled 'Touch Me'. When you tap this it brings up a new view which also has a close button. I've added a screenshot below and you can download the source code here.
The problem I'm having is that I can't seem to port over this .xib code to work in Xcode 4.2 storyboards. I am trying to keep that same 'Touch' button and 'AnotherView' displaying on a brand new 'Master-Detail Application' running iOS 5.
I am struggling to even keep the button displaying on every view. As in, you can tap the button 'Touch Me' to bring up this alternate view at any page - in the table view or the detail view. I hope this makes some sense? Note that I'm NOT talking about the table row, just the top right button in the UINavigationBar.
Please let me know if I can provide any more details! Just trying to build a similar functionality as the 'Touch Me' button in a fresh new iOS 5/Xcode 4.2 Storyboard app WITHOUT any .xib files. thanks in advance
As your know storyboard doesn't use XIBs so you won't be able to follow the tutorial line for line.
I recommended first creating a new storyboard project and select the "Master-Detail Application" template when creating the project. This will create a project with a Navigation controller. You can then follow the tutorial on customizing the navigation bar. When following the first part of the tutorial, you will need to select the initial view,"Navigation Controller", in storyboard and change its class to "KTNavigationBar" after you create that class.