NimbleKit - fast iOS app development

Hellpp!

Problem discussions

Hellpp!

Postby tarnfeld » Tue Jun 23, 2009 5:00 pm

Just upgraded to 1.4?! Help
My old project failed to load... because it hadn't the new stuff.. code was messy so am rebuilding :D But not working :(

Here is my code..
main.html
Code: Select all
<html>
   <head>
      <meta name = "viewport" content = "initial-scale = 1.0, user-scalable = no" />
      <link rel="stylesheet" href="style.css" />
   </head>
   <body>
      <script type="text/javascript" src="NKit.js"></script>
      <script type="text/javascript">
         var tabController = new NKTabBarController();
         tabController.setTabBarForPage("main.html", "Home", "home.png");
         tabController.setTabBarForPage("sms.html", "SMS", "send.png");
         tabController.setTabBarForPage("inbox.html", "Inbox", "inbox.png");
         tabController.setTabBarForPage("account.html", "Account", "account.png");
         
         var wifi = NKIsInternetAvailableViaWifi();
         var celular = NKIsInternetAvailableViaCellularNetwork();
         
         if(wifi == 1) {
         ;
         }
         else {
            if(celular == 1) {
            ;
            }
            else {
               NKAlert("No Network", "An internet connection is required for this applicaion");
            }
         }
         
         NKSetAllowsScrolling("no");
         var navController = new NKNavigationController();
         navController.setTitle("Home");
         navController.setStyle("Black");
      </script>
   </body>
</html>


Thanks in advanced!
Oh and the tabbar works.. just no nav?! :(
tarnfeld
 
Posts: 189
Joined: Mon Jun 15, 2009 9:37 pm

Re: Hellpp!

Postby sunny » Tue Jun 23, 2009 5:54 pm

NKSetAllowsScrolling("no");
has been deprecated and removed, so javascript execution stops at that place, you can prevent page from scrolling using native javascript events.
for example:

<script type="text/javascript">
touchMove = function(event) {
event.preventDefault();
}
</script>
<body ontouchmove="touchMove(event);">
</body>

this code prevents scrolling of the whole page, you can also prevent scrolling the same way of any element on page
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Hellpp!

Postby tarnfeld » Tue Jun 23, 2009 7:18 pm

sunny wrote:you can also prevent scrolling the same way of any element on page


What do you mean by this?
tarnfeld
 
Posts: 189
Joined: Mon Jun 15, 2009 9:37 pm

Re: Hellpp!

Postby sunny » Tue Jun 23, 2009 9:19 pm

you create any element and specify not to scroll by adding <TAG ontouchmove="touchMove(event);"> if you want page to scroll but some elements you want not to scroll
User avatar
sunny
Staff
 
Posts: 2666
Joined: Sat May 30, 2009 5:18 am
Location: Palo Alto, California

Re: Hellpp!

Postby tarnfeld » Tue Jun 23, 2009 10:49 pm

Oh wow so you could put like a textbox or something at the top.. and itll be 'fixed' like it would with css (but safari doesnt allow fixed lol in web apps :( )
cool :D
tarnfeld
 
Posts: 189
Joined: Mon Jun 15, 2009 9:37 pm

Re: Hellpp!

Postby davidigross » Thu May 12, 2011 10:42 pm

More trouble...

I'm trying to use a jQuery library, "touchswipe". It seems the page gets the swipe gesture, not the jQuery code. Is something in NK capturing the swipes?

We all need a swiping picture gallery, with smooth transitions! Please, please, just show us how!
davidigross
 
Posts: 2
Joined: Thu May 12, 2011 8:21 pm

Re: Hellpp!

Postby Big-O » Thu May 12, 2011 11:12 pm

davidigross wrote:More trouble...

I'm trying to use a jQuery library, "touchswipe". It seems the page gets the swipe gesture, not the jQuery code. Is something in NK capturing the swipes?

We all need a swiping picture gallery, with smooth transitions! Please, please, just show us how!


That sounds like a very specific issue and probably deserves it's own thread. Explain more about what you did, what you expect, and show us some code.
-- Big-O
-- Nimblekit Guru, Web Developer, Hopeless Geek

I do freelance!
http://realisticweb.com
User avatar
Big-O
NimbleKit Guru
 
Posts: 1231
Joined: Thu Sep 24, 2009 4:02 am


Return to Troubleshooting

Who is online

Users browsing this forum: No registered users and 1 guest