UIWebView troubles

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

UIWebView troubles

Post by mmiele » Fri Jan 28, 2011 8:59 pm

Hi,
what I need is a specialized web browser which, when launched, automatically open e prefixed, specialized site, with no commands to change location. So I tried starting from the web browser example of the 4.5.3 release. I deleted the "url" field and the related instructions into the card script, and I changed the default site address to that of my site.
Everything worked fine on the simulator, but loading it into a real iPhone, the site loaded fine but the page scrolling loosed the "inertia" and the bouncing behavior: the scrolling went beyond the upper or lower limit, but without bouncing back..
So I reloaded a fresh copy of the stack and I tried deselecting the "travesalOn" property of the "url" field, to avoid the appearance of the keyboard, and hiding it behind the browser. No way! Same behavior!
After many tries it seems that to have the browser working ok, the keyboard must appear, even if for just a moment.
It's a bug? I'm making something wrong? Is There a work around?

Thanks
Mario

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Sun Jan 30, 2011 3:50 pm

Hi Mario,

could you post a zipped version of your problem? I mean a small stack that shows just what you describe? There are so many possibilities to consider that it is hard to know what exactly is going on.

Kind regards

Bernd

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Mon Jan 31, 2011 10:50 am

The attached zip contains the stack. The differences between this stack and the original example are:
  • the "url" field was deleted
  • the references to the "url" field were commented into the card script
  • the default url was changed
I tested the stack on a first generation iPod (iOS 3.1.3) and on an iPhone 3 (iOS 4.2).

You can obtain the same effect simply deselecting the "traversalOn" property of the "url" field.

I made many other experiments, but every time the scrolling only worked after an appearance of the keyboard.

Thanks,
Mario

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Mon Jan 31, 2011 12:00 pm

Hi Mario,

unfortunately the zipped stack did not make it to the post, could you upload it again?
You first have to choose the file to upload then you have to Add the file.

Kind regards

Bernd

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Mon Jan 31, 2011 1:03 pm

True, I forgot to add the file... :mrgreen:
Attachments
Mobile Browser.livecode.zip
(2.86 KiB) Downloaded 343 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Mon Jan 31, 2011 2:12 pm

Hi Mario,

I don't see the behavior you describe. Neither in the Simulator nor on an iPhone (G3). The Website loads, is scrollable and bounces at the top and at the bottom. And no keyboard popping up.

Did you try your example stack and did it show the behavior you describe? If so I maybe did not understand correctly what the problem is.

Kind regards

Bernd

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Mon Jan 31, 2011 5:03 pm

Hi Bernd,

the software runs ok on the simulator. It's on real devices that I find the problem.
I made the tests on a first generation iPod Touch (iOS 3.1.3) and on an iPhone 3 (iOS 4.2.1). The software was loaded on the devices using different computers (an iMac and a Mac Book Pro) and different Apple certificates (the Mac Book is of a friend of mine who develops using objective C).
LiveCode version was 4.5.3 and MacOS X was 10.6.6 (italian).
I think that if you had the problem you'd recognize it immediately. When you, during the scrolling, raise the finger from the display, the scroll immediately stops, there is no gradual deceleration. And there is non bouncing: you can see the gray area beyond your page, and the page bounces back only if you tap on the display.

Thanks again,
Mario

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Mon Jan 31, 2011 6:02 pm

Hi Mario,

I tested with an iPhone G3, System version 4.2.1, same as you.
Livecode version 4.5.3 (same as you)
MacOSX 10.6.6 german, same as you
Xcode 3.2.5

I took the stack you uploaded.
Here is what I get:
When you, during the scrolling, raise the finger from the display, the scroll immediately stops, there is no gradual deceleration
Not for me, works like I would expect.
And there is non bouncing:...the page bounces back only if you tap on the display.
Not for me, bounces allright.
(when bouncing) ... you can see the gray area beyond your page
No bug, it is the default behavior, you can change that with

Code: Select all

iphoneControlSet sBrowserId, "backgroundColor", "255,255,255,
" just white or any other color you define, or

Code: Select all

iphoneControlSet sBrowserId, "backgroundColor", "255,255,255,0"
here the last number is the alpha chanel, setting it to 0 lets a you see the underlying color when bouncing.


So I don't know what is going on.

Please confirm that you saw what you describe with the sample stack you uploaded.

Kind regards

Bernd

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Mon Jan 31, 2011 6:35 pm

Hi Bernd,

I know that seeing the gray area at the end of the scrolling is normal, but usually the page bounce back and the area disappears. Not for me.
I confirm that what I posted is that stack.
I don't know if you can load the compiled application into your device, anyway you can download it at http://sixsides.it/downloads/MyBrowser.app.zip.

Thanks,
Mario

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Mon Jan 31, 2011 7:15 pm

Hi Mario,

unfortunately I can not load the app since I can not change the provisioning profile.
I confirm that what I posted is that stac
So I am at a loss here. No idea what is going wrong.

I worked with your application settings except I added my provisioning profile -> worked
deleted the application settings and made new ones, the default + provisioning profile -> worked

I append your stack in my version, I changed some colors (dont be scared just colored some to see differences ... :) ) and gave the browser a rect, but that should not make a difference, and it worked with the version you posted anyways.

You might want to give it a try, but this a desperate move, should not make any difference.

Sorry, seems there is nothing on my side that I could do to solve the mystery...

Kind regards

Bernd
Attachments
Mobile Browser.livecode.zip
(3.04 KiB) Downloaded 303 times

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Mon Jan 31, 2011 7:28 pm

No way, I hope someone at Runrev is reading these post...
Anyway, a big thank for your tries and your time.

Kind regard
Mario

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Tue Feb 01, 2011 11:37 am

I red on the "scroller iPhone with bounce" about the same quirk I found in the web browser.
So I tried to 'defrost' the scrolling sliding the browser up and then touching the status bar: it worked!

It seems as the browser suffers the same kind of problem of the scroller.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Tue Feb 01, 2011 11:46 am

Hi Mario,
I red on the "scroller iPhone with bounce" about the same quirk I found in the web browser.
So I tried to 'defrost' the scrolling sliding the browser up and then touching the status bar: it worked!
This has been fixed some versions ago.
Please make shure you use Livecode 4.5.3

If you start from the Dock, make shure the Livecode version that is pointed to by the icon is actually 4.5.3

Or else you might to want to reinstall Livecode 4.5.3.

The 'defrosting' problem is no longer in 4.5.3

If you are inadvertently using an older version that could explain the problems you see.

Kind regards

Bernd

by the way, I posted a new version that is much improved, you might want to have a look at it.

mmiele
Posts: 55
Joined: Sun Jan 21, 2007 1:25 pm

Re: UIWebView troubles

Post by mmiele » Tue Feb 01, 2011 12:38 pm

a new version of liveCode?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4166
Joined: Sun Jan 07, 2007 9:12 pm

Re: UIWebView troubles

Post by bn » Tue Feb 01, 2011 12:52 pm

Hi Mario,

I meant to say a reinstall of version 4.5.3

kind regards

Bernd

Post Reply