-
19 Dec 2011 12:47 PM #1
Sencha Touch 2.0 PR3 not working in a UIWebView (iphone)
Sencha Touch 2.0 PR3 not working in a UIWebView (iphone)
Hi Guys,
my sample app (copy/paste from the getting started) works perfect on the Mobile Safari, but when I open it in a UIWebView inside my app it doesn't work. The web app is already on a server, its not built-in the app.
Any hints of how to solve that?
Cheers,
Noel
-
19 Dec 2011 1:46 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,710
- Vote Rating
- 436
what doesn't work?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Dec 2011 4:18 PM #3
- Are you using PhoneGap, Sencha Native, or your own implementation?
- Are you using Ext.Loader? (there are sometimes issues with this).Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
19 Dec 2011 6:16 PM #4
I'm not using phonegap.
It's just a simple hello world.
Its in my own implementation using a UIWebView.
It loads a blank screen. The web app loads perfect in the Mobile Safari but not in my UIWebView.
-
20 Dec 2011 12:16 AM #5
I'm afraid I cannot help you without the source of the actual native application.
Chances are, you are not including the correct JS, or not doing it at the correct time. Or you have an error.
I've done this several times with ST.Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
20 Dec 2011 1:39 PM #6
the codes
the codes
Hi,
my web app code is:
and my native code is:Code:Ext.application({ name: 'Sencha', launch: function() { Ext.create("Ext.TabPanel", { fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'Home', iconCls: 'home', cls: 'home', html: [ '<img width="65%" src="http://staging.sencha.com/img/sencha.png" />', '<h1>Welcome to Sencha Touch</h1>', "<p>You're creating the Getting Started app. This demonstrates how ", "to use tabs, lists and forms to create a simple app</p>", '<h2>Sencha Touch (2.0.0pr1)</h2>' ].join("") }, { xtype: 'list', title: 'Blog', iconCls: 'star', itemTpl: '{title}', store: { fields: ['title', 'url'], data: [ {title: 'Ext Scheduler 2.0', url: 'ext-scheduler-2-0-upgrading-to-ext-js-4'}, {title: 'Previewing Sencha Touch 2', url: 'sencha-touch-2-what-to-expect'}, {title: 'Sencha Con 2011', url: 'senchacon-2011-now-packed-with-more-goodness'}, {title: 'Documentation in Ext JS 4', url: 'new-ext-js-4-documentation-center'} ] } } ] }).setActiveItem(1); } });
as you can see its a simple UIWebView. I don't know whats happening.Code:@implementation ContactViewController - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.title = @"Test" ; } return self; } #pragma mark - View lifecycle - (void)viewDidLoad { [super viewDidLoad]; [self loadWebView] ; } - (void)loadWebView { NSURL *url = [NSURL URLWithString:@"http://feedback.mobihouse.com/"]; _webView = [[UIWebView alloc] initWithFrame:self.view.frame] ; _webView.scalesPageToFit = NO; [_webView loadRequest:[NSURLRequest requestWithURL:url]]; [self.view addSubview:_webView] ; }
Cheers,
-
20 Dec 2011 2:52 PM #7
Does it work in a browser? Which Js file are you including in your index.html file?
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.
-
20 Dec 2011 3:55 PM #8
the html code is:
Code:<!DOCTYPE html> <html> <head> <title>Sobre</title> <link rel="stylesheet" href="touch/resources/css/sencha-touch.css" type="text/css"> <script type="text/javascript" src="touch/sencha-touch-all.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body></body> </html>it runs in the browser but doesn't run in the UIWebView.
-
20 Dec 2011 3:56 PM #9
it runs in the browser but doesn't run in the UIWebView. I don't know why.
-
20 Dec 2011 6:46 PM #10
Sencha Inc.
Robert Dougan - @rdougan
Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.


Reply With Quote