ionic 2 Loading is not centered - ionic2

The example code for the ionic 2 Loading feature that is shown in their docs is:
let loading = Loading.create({
content: 'Please wait...'
});
this.nav.present(loading);
Their online example shows the loading spinner appearing in the centre of the screen but when I try it in my app it appears in the top left hand corner.
How do they get it to appear in the centre?

Do you have the latest CSS/Sass in place?
The following works fine for me:
import {Loading} from "ionic-angular"
// put this inside a method
let loading = Loading.create({
content: 'Please wait...'
});
this.nav.present(loading);
See a working example here:
http://plnkr.co/edit/HzuzbF9sFVEKRsBrnIVI?p=preview
Look at home.ts for the code.

Related

How to fix the problem of Sitecore position fixed in Experience editor? - SXA 9.3

How to fix the problem of having the navbar as position: fixed in Sitecore 9.3. I saw some solutions on the blogs, but it only fixes the issue on the Sitecore 8 versions.
Basically when I open the partial design in Sitecore Experience Editor, I have set my navbar as position fixed in theme css file, and it shows the navbar below the scWebEditRibbon. I also saw that scWebEditRibbon is now position fixed, still it does not fix my issue since I also have position fixed on my element.
I fixed the issue by using the script provided Richard Szalay, I just changed the variable as you can see here:
Here is the script:
// Repositions a position-fixed header so that it always appears under the SC experience editor ribbon
define(["sitecore"], function (Sitecore) {
return {
priority: 50,
execute: function (context) {
// TODO: Change this CSS selector to suit your application
var FIXED_NAV_SELECTOR = '#navbar';
// the 'cross piece' is a blank div that is sized to match the iframe content (where the actual ribbon is)
var scWebEditRibbon = window.parent.document.getElementById('scWebEditRibbon');
var nav = window.parent.document.querySelector(FIXED_NAV_SELECTOR);
if (scWebEditRibbon && 'MutationObserver' in window) {
var observer = new MutationObserver(function (mutations) {
nav.style.top = scWebEditRibbon.style.height;
});
observer.observe(scWebEditRibbon, { attributes: true, attributeFilter: ['style'] });
}
}
};
});

App with both SideDrawer and No Sidedrawer

I have a app working nicely with a sidedrawer, but would like to add pages without that menu.
The magic for launching a sidedrawer seems mostly in app.js:
new Vue({
render (h) {
return h(
App,
[
h(DrawerContent, { slot: 'drawerContent' }),
h(Home, { slot: 'mainContent' }
]
)
}
}).$start();
And we could launch a home page without that drawer:
render: h => h('frame', [h(Twisty)])}).$start();
But how to launch the sidedrawer menu later, after viewing the drawer-less pages?
OK, I may have been thinking about this wrong.
By making the 'menuless' page just another entry in DrawerContent.vue, and adding
android:visibility="collapsed"
ios:visibility="collapsed"
to that page's ActionItem, the page appears menuless. Then a nice
this.$navigateTo(Home);
gets us back to the regular sidebar navigation.
(I'd actually tried this before, and it was failing, but because I was calling YoutubePlayer in Preview, not for any sidebar related issue.)

Google Sign In showing blank screen in iOS

I have implemented code as per the google SDK documentation line by line in my app, but still when I click on google sign in button app shifts to new view controller with webview with blank screen. Have tried multiple solution found here : GIDSignIn white screen on iOS 91. But no lucks with resolving the problem , have attached the screen shot for getting closer look about the screen.
Following are the pods that I'm using,
Running XCode 9.1, iOS 10.0 and later. Kindly request someone to help.
Update: View Hierarchy
Update: viewDidLoad's code:
GIDSignIn.sharedInstance().uiDelegate = self
if self.isChangePassword {
self.addSignInView()
}
else {
self.addSignUpView()
}
fileprivate func addSignInView() {
guard let signInEmailView: SignInEmailView = Bundle.main.loadNibNamed(NibNames.SignInEmailView.rawValue, owner: self, options: nil)?[0] as? SignInEmailView
else {
return
}
signInEmailView.delegate = self
gaManager.trackScreen(screenName: ScreenNames.SignIn.rawValue)
self.animateView(signInEmailView)
}
fileprivate func addSignInView() {
guard let signInEmailView: SignInEmailView = Bundle.main.loadNibNamed(NibNames.SignInEmailView.rawValue, owner: self, options: nil)?[0] as? SignInEmailView
else {
return
}
signInEmailView.delegate = self
gaManager.trackScreen(screenName: ScreenNames.SignIn.rawValue)
self.animateView(signInEmailView)
}
I have the same problem. I use the UIAlertView to confirm user really want to do authorization. It will show the blank screen. If I remove the UIAlertView and show the authorization view directly. It works fine.
The problem also show in the Dropbox authorization screen.
If you not use UIAlertView , please try to pass the top most controller
https://github.com/dropbox/dropbox-sdk-obj-c/issues/182
Hope this can do some help.
Finally after so many days found the problem. I was showing splash view from my appDelegate using refrence of UIWindow which was adding and removing an imgview as subview to the window. So it was somehow messing with the UINavigation's stack and my view controller was not getting any reference to the UINavigationController. After removing that code it's working just fine. Also came to the solution that, if I want to show splash screen, as I can't use UIWindow's reference, I have to add new VC and write my all navigation code there. #TedYu Thank you very much for the help. :)

famo.us: Can I use "DeviceView" in my own app?

I am building a simple POC using famo.us. I would like to use the device view from the famo.us University lessons but when I write this code (slightly modified from what I found in the tutorials) nothing renders:
/*globals define*/
define(function(require, exports, module) {
// import dependencies
var Engine = require('famous/core/Engine');
var ImageSurface = require('famous/surfaces/ImageSurface');
var StateModifier = require('famous/modifiers/StateModifier');
var DeviceView = require('./DeviceView');
// create the main context
var mainContext = Engine.createContext();
// your app here
var logo = new ImageSurface({
size: [267, 102],
content: '/content/images/t-logo-black.png'
});
var logoModifier = new StateModifier({
origin: [0.5, 0.5]
});
var logoNode = mainContext.add(logoModifier);
logoNode.add(logo);
});
It appears that just adding the line var DeviceView = require('./DeviceView'); is what is causing the problem because just adding that one line to a working app seems to make everything not work that was working before. So I have 2 questions:
How do I make the require for DeviceView work
Is there a place I can go to find this sort error? Right now a blank screen is not very helpful. :)
Thank you!
Device view is not a currently an open source view. I have heard they are ridding a few bugs but it will be released soon.
Next time you see something not loading, be sure to check the directory, to ensure the file actually exists.
I have found debugging a bit tricky thus far using famous. Really for your problem, only the console would give you what you are looking for. In the case of a view, if it is not showing up how I expect, I often drop an id or class into the view, so it because searchable in the DOM.
Creating better debugging tools would add to the the long list of things famo.us is looking to build in the coming months. As an early adopter, it's a bit of a tough road.
Good Luck!
to make it work add this code:
//var DeviceView = require('DeviceView');
var View = require("famous/core/View");
in createDevice() function change :
device = new View(deviceOptions);
var deviceModifier = new StateModifier({
size: [300,400],
origin: [0.5, 0.5]
});
comment out any GlobalEvents.
That is a custom view made for the lessons which is not provided with the famous package for download. You could inspect the source code of the lessons page and try to discover the URL from that JS file... But I think it is not going to be so easy.
https://github.com/hinablue/famous.tw/tree/master/deviceView
That part is because of error.. take a look at the link above
That is a custom view made for the lessons which is not provided with the famous package for download. You could inspect the source code of the lessons page and try to discover the URL from that JS file... But I think it is not going to be so easy.

how to know if grid or list view is active with custom magento page

I have a custom product list page and i´m using the following code to show the pagenumbering and filters:
$pager = $this->getLayout()->createBlock('page/html_pager');
echo $this->getLayout()->createBlock('catalog/product_list_toolbar')->setChild('product_list_toolbar_pager', $pager)->setCollection($products)->toHtml();
If i'm changing the mode from grid to list view nothing happens.
How can i get the active mode (grid or list).
Magento normaly uses $this->getMode() but this one doesnt work.
I have fixed it with the following code:
$mode = $this->getLayout()->createBlock('catalog/product_list_toolbar')->setChild('product_list_toolbar_pager', $pager)->getCurrentMode();
Another solution,
if(Mage::getSingleton('catalog/session')->getDisplayMode())
{
$productListMode=Mage::getSingleton('catalog/session')->getDisplayMode();
}