Sencha Touch 2 fixed header - sencha-touch

Is there a way to have a fixed non animated header in a sencha app and still retain page animation and browsing history?
I need my header to not animate on a page slide. The way i tried it is:
-main container (v box)
--header container
--card container(card layout)
---card
---card2
---card3
Etc
And I manually switch the cards inside the card container with setActiveItem(index)
The header is never animated in/out but I dont have history now so the only way to have a back button is manually hard coding it with setActiveItwm(prevIndex)
Its an unfortunate and dirty solution maybe somebody else has a better one.

Yes I achieved it using sencha architect to test. From memory I created a base container that had layout vbox. Inside that I had a top tabpanel and under that a tabpanel. I then set the flex on the top panel to 0.2 and the tabpanel to 0.8. That way my header will always be 20% height on any device. I hope this helps.

You require Ext.navigation.View

Use Ext.navigation.View and create basic navigation between views...then hide the navigation view you can do that by making the navigationBar property as hidden:true
Next have a common navigation header as you have mentioned above...
Going forward using a button lets say would be by using
button.up('navigationview').push({xtype: 'card2'});
This button will be somewhere in your card which takes you to next card
Similarly for going back on button click
button.up('navigationview').pop();
button.up('navigationview').pop(2);//Will take you two views back and so on
These buttons will be on your common header

Related

Codenameone form with header picture - how to navigate?

I'm writing a codenameone application where I want to have an image displayed across the top of the screen as a header. I do not want to include this image in every form/container that I create so therefore I came up with the following solution:
I have a Main form which contains the image (North) and a container (Center) which will then hold all the components of the specific screen that I want to show.
I will then create containers that represent each individual screen. My idea was to add these containers to the container of the main form, one by one and that navigation between them would be handled by changing the contents of that main screen container.
But I cannot find out how to make this work. As long as I have one single screen to show it is easy... The main form container can be an embedded container that is set to show the container for the single screen. But when I try to navigate to another I cannot make it work.
So, is there another approach I should use?
If not, how should I handle navigation between screens?
Is this with a GUI builder app or with a handcoded app?
Either way a simple way of customizing this if your app has a side menu or Toolbar would be to customize the TitleArea UIID to include your background image. E.g. start with a modern theme like the Business Theme and in the designer theme change the title area border property to be "Empty".
Then define the background image to be the image you want with "scaled to fit" or "aligned bottom" depending on what you want. Make sure to include enough space in the image for the title are and use a multi image so it will adapt for other OS's.

swift adding zoom to container view

I have a page view controller embedded inside a container view in order to swipe between images. But now I am trying to add a touch that will make the image go full screen "lightbox" with zoom available and also swipe through the images while in full screen mode.
I can get it to work, and messing around with auto layout seems to be much work consider I have a lot of other stuff in that VC.
So does anyone know a good image slider from github written in swift? - without the need of cocopods.
thanks!
It's easy enough to write one yourself. In full-screen mode, use another UIPageViewController, because it already has the swipe left & right support built in.

objects inside Ext.tab.Panel

I am writing simple apps with Sencha Touch 2. I see that the basic object in app/view/Main.js is Ext.tab.Panel.
What other Ext objects can be embedded directly into Ext.tab.Panel? Where can I look up this information?
From the Sencha Touch 2.3.1 docs, Ext.tab.Panel section:
http://docs-origin.sencha.com/touch/2.3.1/#!/api/Ext.tab.Panel
Tab Panels are a great way to allow the user to switch between several
pages that are all full screen. Each Component in the Tab Panel gets
its own Tab, which shows the Component when tapped on. Tabs can be
positioned at the top or the bottom of the Tab Panel, and can
optionally accept title and icon configurations.
Basically, you can put any view class which is subclass of Ext.Container inside a tab panel.
You can put any view you want.You can even put another container inside a container
Have a look at sencha touch docs.
http://docs.sencha.com/touch/2.3.1/#!/guide/views

iOS layout: alternative to tabs?

I'm working on a iPhone app which shows an mobile webform in a UIWebView. I'm using a default iOS layout with a navigation and tab bar.
The mobile webform is displayed in a UIWebView in the white area. Since the webform has a lot of input fields, we really need as must space for it as possible. Because of this, we are planing to remove the tabs in the bottom. Over time, there will be more tabs/sections, so it is not a solution to just add a button for each section in the left side of the navigation bar. On a iPad a popover could easily be used to handle this.
Is there a standard iOS layout mechanism to handle this change of sections/views without using tabs?
You could do something long the lines of Path or the new Facebook app and have the "table of contents" behind the Navbar and the navbar slides away (along with the child view) to reveal it. When done right (ie smoothly) I think the effect is really cool.
This would also work great as you add more and more options, since the table could just scroll.
Here is a framework that might be you started: http://www.cocoacontrols.com/platforms/ios/controls/iiviewdeckcontroller
I would consider replacing the navigation bar's title with a control that lets you switch between tabs. You can assign the bar's titleView property to a control or a button and it will generally do the right thing.
If you're limited to 2-3 tabs, you could simply use a UISegmentedControl.
If you want more, you could use a button which, when tapped, pops up a view that allows you to select the view you want. This could be a modal table view, or you could slide up a UIPickerView from the bottom of the screen, similar to the keyboard.
I use this technique in an app of my own, screenshots here. Tapping the button cycles between views (in this case, I'm changing the contents of the table cells); tap-and-hold slides up a picker.
Another possibility would be to arrange your different forms on pages in a scroll view with a page control at the bottom, à la Weather. The best option, though, if you’re going to have a particularly long list and want to keep your screen real estate, is probably the FB/Path-style sidebar table.
I ended up using a UIActionSheet but I think it in other situations would be more stylish to use a controller like the IIViewDeckController.

Animating Tab Bar page switching

I'm quite confused with the whole animation stuff in iPhone SDK. I tried to study throught the SDK documentation, this website or tried googling it out without success.
I'm unable to get my scenario work.
I have single XIB file, with tab bar and a 4 tabs.
In a special event i want to switch from one page to another "in code", so I call eg: [tabController selectedIndex: 0].
I need this transition to be animated. Is there a way?
If user switches tabs manually, no animated transitions are needed
Also I have one subquestion:
In one of the tabs I have a UITableView with set of items. When user clicks any of these items, another set of items are beign shown (sort of hierarchy browser)
I tried to animate this transition using -deleteRowsAtIndexPaths:withRowAnimation: and -insertRowsAtIndexPaths:withRowAnimation:, but without luck.
Desired transition is shifting the old items set to the left side and the new items from the right side.
This is first time of my iPhone development, when I got lost even with all the forums and documentation. :)
Thanks in advance to anyone trying to help me!
As for your first question: Yes you can.
Try this link for some answer:
transition on tab bar sample code.
In short words: you should add a delegate object to handle the tab bar switching by setting the tabBarController.delegate = self.
Yet, what this forum post won't tell you is that you need to "import" some framework to do it.
First - right-click on the framework folder on the left hand list in Xcode and add an existing framework named: "QuartzCore.framework".
Than - add these lines to your tab bar holder (on .h file):
#import <QuartzCore/CAAnimation.h>
#import <QuartzCore/CAMediaTimingFunction.h>
As for your second question, try to replace the datasource (array or what ever) or create login function on the cell to replace its content.
Enjoy!
First Question: No, you can't animate tab switching. Please read Apple's Human Interface Guidelines on this. Tabs are meant to switch instantly. An animated transition would break the "tab" paradigm.
Second Question: When you tap on a row, the user does not expect other rows to disappear and new ones to appear. Instead, this sounds like a case for a UINavigationController. Please refer to Apple's sample code, specifically the UICatalog for sample code on how to implement this.