05-27-2013 02:15 AM
In my app, there is a login page for the user to get authenticated. When the user is in a page and trying to access some data by pressing a button, a login page should be shown to the user if he is not logged in. This pogin page should be displayed as a overlay on top of the current page. How is it possible ?
05-27-2013 02:22 AM
Hi! I think displaying it in a sheet is the easiest approach. Some sample code:
05-27-2013 03:39 AM
Thanks,. that works.. !!! but, is there any way to show the login page as smaller in size that the background page ? like, jus to show that this page is on top of the previous page?
05-27-2013 11:13 AM
I second using a Custom dialog, or possibly look into using a Prompt. There is one set up for login credentials: https://developer.blackberry.com/cascades/document
06-07-2013 03:27 AM - edited 06-07-2013 03:29 AM
I used a custom dialog. I have a container with max and min height and width and I use that as the over lay prompt. But it doesnt look good. I mean, since it doesnt have the shadow under the borders, the look n feel of this dialog is bad..
Now, how to skip this prompt? If the user doesnt want to enter the credentials and want to skip the login page, how does he go back? clicking on outside the prompt should dismiss the page. but how do we do that?
06-07-2013 06:48 PM
You have to code in the shadow yourself... so if you make the Dialog the full size of the screen with a background something like:
background: Color.create(0.0, 0.0, 0.0, 0.5)
And you can have your "box" on top of that. Illustrated in my screenshot posted in this article: http://bbcascadescode.tumblr.com/post/46623882388/
Then to have an "exit" button you can handle that multiple ways:
1. Have a Button with onClicked: yourDialogName.close(); the dialog
2. If you want to have it if the click anywhere outside of your "box", apply an onTapped gesture to that area that fires yourDialogName.close();