Discussion Board
-
使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-21, 08:58
#1
Regular Contributor
请教各位高人,在真机上为什么使用symbian浏览器CBrCtlInterface访问http链接时总是出现空白页面啊?在模拟器上则可以正常显示页面,请遇到过此问题的高人指点一下,谢谢了
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-29, 09:48
#2
Regular Contributor
请问有没有哪位高手之前做过CBrCtlInterface浏览器之类的开发?帮忙解决一下吧
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-30, 06:16
#3
Registered User
手机问题吧,我换了架手机就可以显示了,我的是n76
用CBrCtlInterface的例子不太理想,关键是那个控件的初始化函数,参数不正确就不会正确显示
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-30, 06:27
#4
Regular Contributor
真机上我使用CBrCtlInterface 访问http链接时,有时候可以将页面正常的显示出来,但是有的链接地址就是无法正常显示,总是空白页面。使用E66、N95两款手机进行的测试,结果都一样。通过MBrCtlLoadEventObserver 的HandleBrowserLoadEventL方法观察了一下页面加载的状态,发现正常显示与不正常显示所经历的状态有所不同,我觉得可能与这个有关系。希望遇到过类似问题的大哥帮忙指点一下,非常感谢。
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-30, 07:54
#5
Registered User
这个情况我没遇到过,你能贴代码和不能正确显示的链接么?
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-04-30, 09:04
#6
Regular Contributor
我的程序是用SDK的例子程序BrCtlSampleApp 改的,构造
构造CBrCtlInterface的代码如下:
void CBrCtlSampleAppContainer::InitBrowserControlL() //初始化浏览器控件
{
CreateBrowserControlWithObserversL(/*TBrCtlDefs::ECapabilityDisplayScrollBar |*/TBrCtlDefs::ECapabilityLoadHttpFw |TBrCtlDefs::ECapabilityGraphicalHistory |TBrCtlDefs::ECapabilityGraphicalPage
,TRect(TPoint(0,0), TSize(240,320)));
// _LIT(KUrl, "file:///c:\\BrCtlSampleApp\\sample6.htm");
_LIT(KUrl, "file:///");
TFileName filename(KUrl);
CFile* file = CFile::NewLC();
filename.Append(file->GetAllName("sample2.htm"));
CleanupStack::PopAndDestroy(file);
iBrCtlInterface->SetRect(TRect(NEWS,TSize(240,320)));
iBrCtlInterface->LoadUrlL(filename/*,iIap*/);
// _LIT(KUrl, "file:///c:\\BrCtlSampleApp\\sample6.htm");
return;
}
void CBrCtlSampleAppContainer::CreateBrowserControlWithObserversL(TUint aCapabilities,TRect aRect)
{
if (iBrCtlInterface)
{
iBrCtlInterface->RemoveLoadEventObserver(iBrCtlSampleAppLoadEventObserver);
iBrCtlInterface->RemoveStateChangeObserver(iBrCtlSampleAppStateChangeObserver);
delete iBrCtlInterface;
iBrCtlInterface = NULL;
}
iBrCtlCapabilities = aCapabilities;
if (iBrCtlInterface == NULL)
{
iBrCtlInterface = CreateBrowserControlL(this,
aRect,
iBrCtlCapabilities,
TBrCtlDefs::ECommandIdBase,
iBrCtlSampleAppSoftkeysObserver,
iBrCtlSampleAppLinkResolver,
iBrCtlSampleAppSpecialLoadObserver,
NULL);
iBrCtlInterface->AddLoadEventObserverL(iBrCtlSampleAppLoadEventObserver);
iBrCtlInterface->AddStateChangeObserverL(iBrCtlSampleAppStateChangeObserver);
}
}
程序启动时先从本地读取sample2.htm页面进行显示,然后响应按键时,再使用iBrCtlInterface的iBrCtlInterface->LoadUrlL(*iLoginUrl);方法去访问服务器,iLoginUrl的值为http:或者https:通信时接入点选择的是cmwap。在这种情况下有的链接可以显示,有的链接显示为空白页面。链接地址肯定正确,因为使用nokia手机的webkit都可以正常访问
void
CBrCtlSampleAppLoadEventObserver::HandleBrowserLoadEventL(TBrCtlDefs::TBrCtlLoadEvent aLoadEvent,
TUint aSize,
TUint16 aTransactionId)
{
TBuf16<256> tgt;
_LIT(KHandleBrowserLoadEvent, "Load event = %d, size = %d, trId = %d");
tgt.AppendFormat(KHandleBrowserLoadEvent, aLoadEvent, aSize, aTransactionId);
rl(tgt);
/* if(aLoadEvent == TBrCtlDefs::EEventUrlLoadingStart)
{
iContainer->DrawNow();
}*/
if(aLoadEvent == TBrCtlDefs::EEventLoadFinished)
{
iContainer->BrCtlInterface()->MakeVisible(ETrue);
}
iContainer->DrawNow();
}
另外通过上面的函数打日志发现,正常显示时和显示空白页面时aLoadEvent值的变化顺序是不同的。
正常显示时,aLoadEvent值的变化顺序与加载本地页面的变化顺序相同,显示空白页面时的顺序则比较混乱,但可以看出EEventContentFinished的状态已经得到了
Last edited by allenliujiansong; 2010-04-30 at 09:35.
-
Re: 使用symbian浏览器CBrCtlInterface访问http网址时为什么总是出现空白页面啊?
2010-05-02, 09:41
#7
Registered User
可以这样试试:
iContainer->BrCtlInterface()->MakeVisible(EFalse);
iContainer->BrCtlInterface()->MakeVisible(ETrue);
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules