09-07-2012 12:47 PM - edited 09-07-2012 12:48 PM
Hi I have this code and I want to assign a ProgressIndicator {} to load the page while opening google.com
import bb.cascades 1.0
Page {
id: sixthPage
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Both
pinchToZoomEnabled: true
}
WebView {
url: "http://google.com"
onLoadProgressChanged: {
// Update the ProgressBar while loading.
progressIndicator.value = loadProgress / 100.0
}
onLoadingChanged: {
if (loadRequest.status == WebView.LoadStartedStatus) {
// Show the ProgressBar when loading started.
progressIndicator.opacity = 1.0
} else if (loadRequest.status == WebView.LoadSucceededStatus) {
// Hide the ProgressBar when loading is complete.
progressIndicator.opacity = 0.0
} else if (loadRequest.status == WebView.LoadFailedStatus) {
// If loading failed fallback to inline HTML, by setting the HTML property.
html = "<html><head><title>Fallback HTML on Loading Failed</title><style>* { margin: 0px; padding 0px; }body { font-size: 48px; font-family: monospace; border: 1px solid #444; padding: 4px; }</style> </head> <body>Oh ooh, loading of the URL that was set on this WebView failed. Perhaps you are not connected to the Internet?.</body></html>"
progressIndicator.opacity = 0.0
}
}
settings.zoomToFitEnabled: true
settings.webInspectorEnabled: true
}
}
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
title: "Atras"
onTriggered: {
// _navPane is set in code.
navigationPane.pop();
}
}
}
}
otra cosa tengo una imagen y quiero que al dar click me envie a una pagina web, no encuentro esa accion en un ImageView {
HelpME
@Marcossit
09-07-2012 05:39 PM
I need information about that... too. any information
09-07-2012 10:00 PM
import bb.cascades 1.0
Page {
content: Container {
id: container
background: Color.LightGray
layout: StackLayout {
layoutDirection: LayoutDirection.TopToBottom
}
ProgressIndicator {
id: progressIndicator
topMargin: 10
leftMargin: 10
bottomMargin: 10
fromValue: 0
toValue: 100
preferredWidth: 800
} // progress of the webview loading
ScrollView {
scrollViewProperties {
scrollMode: ScrollMode.Both
}
layoutProperties: StackLayoutProperties {
spaceQuota: 1.0
}
Container {
background: Color.LightGray
layout: StackLayout {
layoutDirection: LayoutDirection.TopToBottom
}
} // container within scrollview
} // scrollview
} // main container
}// page
09-07-2012 10:54 PM
Thanks Bro