Sencha Touch add view inside viewport, position it absolute, on top of all other views of the app - sencha-touch-2

In Sencha Touch, I have created a view which contains some legal text.
How can I add that view inside the ViewPort, make it position absolute and make it sit on top of all other views from the Viewport?
The view is basically a legal disclaimer, with a transparent background, which needs to always be visible in the viewport, on top of all other views.

If I understand correctly your requirements, you can do that by using a simple Ext.Container with centered: true.
See an example here: https://fiddle.sencha.com/#fiddle/5s9

Related

How do I fix empty 44px space in iOS7 view with ViewDeckController?

I am in the process of transitioning an app to iOS7. All of the views throughout the app have a 44px empty space at the bottom that appears to be for a bottom toolbar or something, but I am not trying to display a bottom toolbar. This space also exists on views that do have a bottom toolbar and the toolbar just shows directly above it.
The red space shown is actually a view behind the black view. No matter what size I set the frame of the black view to, the red space is always shown. I am also hiding the status bar in plist, so don't know if this is an artifact from that or if it has something to do with navigation bar as they are both normally 44px in height.
I have looked at the transitioning guide and haven't found anything that's worked. Any ideas to what could be causing this and how to fix?
UPDATE:
I have tried setting edgesForExtendedLayout = UIRectEdgeAll and extendedLayoutIncludesOpaqueBars = YES (also tried NO) with no effect. When I look at the subviews of the navigation controller it shows a UIToolBar as hidden, but shows it contains a frame in the exact area the view refuses to resize to even with autolayout constraints.
UPDATE 2:
This is actually a problem with ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets it's center view bounds.
I believe it has to do with the UINavigationBar. Try toggling the following options in Storyboard and see if it solves the problem. Namely, the 'Extend Edges' options:
These options can also be set in code with the edgesForExtendedLayout and extendedLayoutIncludesOpaqueBars properties on UIViewController.
If you are transitioning to iOS 7, you should be using an Auto Layout constraint to anchor to the Bottom Layout guide. Control drag from your view to the Bottom Layout guide and choose Vertical Space from the popup menu.
Using frames in iOS 7 is harder and is the way of the past.
Auto Layout is hard to grasp at first, but it is very powerful once you get the feel.
This is actually a problem with third party library ViewDeckController (https://github.com/Inferis/ViewDeck) and the way it sets centerViewBounds for IIViewDeckControllerIntegrated. I was able to figure it out after changing to IIViewDeckControllerContained and seeing the view sized correctly.
In IIViewDeckController.m, just return self.referenceBounds for iOS7 like it does for IIViewDeckControllerContained.

Can't seem to achieve the same effect on my slide menu as Any.Do

I am trying to create the same type of slide-up/pull-up menu (from the bottom) as the Any.do iPhone app, but not having any success.
The issue I am running into is the app was built with storyboards so I am thinking I might have to scratch that idea and use just code.
Any ideas?
There is no need to get rid of your storyboard to recreate this, that's what IBOutlets are for. Any way, it looks like this was made by creating a UIScrollView that takes up the entire screen. Then add a UITableView to the upper section of the scroll view. Mind you in order for this to work, you'll need to disable scrolling on the scroll view in the background.
From there you can programmatically add the other elements to the scroll view to be rendered off screen, since there are only three they can probably just be buttons. And finally, since scrolling is disabled on the background scroll view you can add an image with a UISwipeGestureRecognizer at the bottom of the screen to manually change the scroll view's content offset property.

Grid view with background image horizontal scrolling

I'm trying to implement a grid view menu, with horizontal background scroll of three images triggered by swipe gesture, so only the background images are scrolled while icons remain still. I investigated AQGridView, GMGridView, OHGridView, but they seem to not include this feature, so I decided to implement my own grid view with custom buttons placed in grid formation. My doubts are how to implement the background image scroll. I have searched for different solutions, but I'm not able to figure out how to solve it.
Many thanks
If I understand your question correctly you could make a view with 2 subviews: a) the grid of icons (UIImageView) and b) a scroll view with your background images in paging mode (UIScrollViewController).
Just make sure your icons do not receive touches, so that the scrollview gets the touches.
If you want to make the icons tap-able, then it's a little more complicated; you could create an invisible layer on top and then manually handle the touches, which will get complicated. Or, what I would do, place the icons as subviews on the plain scrollview, and then move the icons in the equal and opposite direction that the scrollview is moving in to create the illusion that the icons are standing still, this will simplest to implement but is a bit of a hack. Mathematically speaking you want to apply a transformation to the scrollview and apply the opposite transformation to the icons which are in the scrollview's coordinate system so that in the global coordinate system (the screen) your icons do not move.

Could the view to be pushed up when the keyboard occur?

I have created some textfields at the bottom that required users to entry. Is there any method that can push up the view automatically when the keyboard occur?
See Apple's Moving Content That Is Located Under the Keyboard, or this implementation based in Calculating Area Covered by Keyboard.
Basically you have to mount your view on a UIScrollView and add a bottom content inset with the same height than the keyboard. Then scroll using setContentOffset:animated:. This is a generic solution that you can reuse.
A more simple but non generic way is, if you have enough space at the bottom of your view without editable controls, you just scroll to a fixed position for each edit box.
use the -contentoffset property of your view.

Paging Horizontally with vertical scroll on each page!

In my app I use a page control and a UIScrollView to page horizontally, I'd like to be able to enable vertical scrolling on each page. Now I know you can nest UIScrollViews in order to achieve this, there is however one problem in my project. Each of the pages uses a view controller consisting of a view, with a background image (different image for each page). This background image should not move while scrolling up and down.
Now what I want is the ability to have buttons, regular rect buttons, which I create in Interface Builder (since I want to be able to design and update the positions easily) and which then can be scrolled vertically.
So it should be like this:
You see a screen with a page-control on the bottom, above it an image with buttons over it. When you scroll sideways, you go to another page, again with an image (another one) and with different buttons. Now whenever you scroll vertically on a page, the buttons should be scrollable (so I can have a LOT of buttons on 1 page), but the image should maintain it's position.
So I figured, I just add another scroll view on top of the view with the background image. This works fine since I now have my buttons hovering over the background image and I have a separate nib file for each page including the buttons. But when I do it like this, the scrollview with the buttons becomes un-scrollable vertically. I don't know why this is happening, so could anyone suggest me how to achieve the wanted result?
I'd be really really grateful!
Thanks,
Fabian