I've been trying to add an UIActivityIndicatorView to the google map sdk based view that will animate while the pins are loading. The map loads and the pins drop, but the activity indicator is masked, hidden or not included. I've been successful with this same behavior using the iOS based map implementation, but would prefer to do this in google maps if possible. Could this have anything to do with the threading behavior?
Thanks,
res
//view's .h
//this was created from dragging from the view to the .h file
#property (weak, nonatomic) IBOutlet UIActivityIndicatorView *activityIndicator;
//view's .m
#synthesize activityIndicator;
...
//viewDidLoad calls a function that kicks off the animation
self.view = mapView;
[self.mapView setDelegate:self];
[self.activityIndicator startAnimating];
//later after the final pin is dropped the following is called
[self.activityIndicator stopAnimating];
If you are using the standard code from google to add the map view, you may be overwriting the root view, which would have the activity indicator on it.
Can you post the code you use to add the map view?
Related
I use Qt 5.5.0 and Qt Creator 3.4.2 on Mac-book, I want to open second qml on button click, I want to develop application in which login page come and after login control move to next page.
I try suggestion of stackoverflow, but still I face problem to open next qml on button click.
I tried
button2.onClicked:{
var component = Qt.createComponent("test.qml")
var window = component.createObject(root)
window.show()
}
How can I create a new window from within QML?
In upper case error come related to root, ReferenceError: root is not defined. I gave root id in test.qml file.
I also tried many more example to solve to develop functionality. Please give brief idea or code to develop this functionality.
The code below works, Take note of the property status and the function errorString() – they will give you information in debugging (.e.g. "file not found" errors, components not ready, etc).
See these pages for background:
Dynamic QML Object Creation from JavaScript
Component QML Type
Window QML Type
function createWindows() {
var component = Qt.createComponent("Child.qml");
console.log("Component Status:", component.status, component.errorString());
var window = component.createObject(root, {"x": 100, "y": 300});
window.show();
}
For this type of ui I'd use [StackView][1] component that allows also animations between transitions. Other solution is to use a Loader component.
I have an iOS 6 app that I am updating to work with iOS 7 and to make it use storyboards. I am trying to use multiple storyboards so that I can break my project down into modules for each screen in the app. So far this has worked out fine but now I need to provide a way to navigate between the various storyboards while still making the work like it did in iOS 6 (but with updated artwork).
I don't use UINavigationController in my existing iOS 6 app and I would prefer not to use it as up to now I have been able to navigate back and forth between XIB's using code on UIButton tap gestures. The UINavigationController doesn't make it easy to customise how the navigation buttons look from what I have learned so far about it.
I found this very clean way of moving between view controllers that are on different storyboards https://github.com/rob-brown/RBStoryboardLink by passing the name of the storyboard in as an attribute.
But it only seems to work when UINavigationController is used. I get an error "Push segues can only be used when the source controller is managed by an instance of UINavigationController" without UINavigationController.
Is there a way to navigate between storyboards by only using the above RBStoryboardlink but without the need for UINavigationController?
Push segues can only be used when the source controller is managed by an instance of UINavigationController
This means you are trying to push a view controller to the source while source don't have any navigation controller stack.In that case, you should try to add the instantiated view controller's view as subview to the source view controller's view.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:#"Main" bundle:nil];
UIViewController *viewController = [mainStoryboard instantiateInitialViewController];
[self.view addSubview:viewController.view];
or you modally present, that purely depends on your requirement.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:#"Main" bundle:nil];
UIViewController *viewController = [mainStoryboard instantiateInitialViewController];
tabBarViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:tabBarViewController animated:NO completion:NULL];
Has anyone tried to click on a google map displayed in Qt QWebView via one of QWebView's mouse event methods? I want to do this in this way becouse I need to run some actions both in Qt and in google map (when I click on map I want to add e. g. a bus stop - it'll load inside the programme and the marker will apear on the map). I've got a method for adding a placemark and I know I can call it, but I've got problem with passing correct position.
void MyWebView::mousePressEvent(QMouseEvent * e) {
QString command = "placeMarker(new google.maps.LatLng(";
command.append(new QString(e->x()));
command.append(", ");
command.append(QString(e->y()));
command.append("))");
this->page()->mainFrame()->evaluateJavaScript(command);
}
I can create an Outlet from a ViewController to a View by Ctrl Drag between viewcontroller bar button and the view.
It appears in the context view of the ViewController Bar button.
Where does the outlet created like this appear in code? (or doesn't it?).
The problem I am having is that when I make an Outlet from a view to its controller I sometimes (frequently?) find the pop up choice does not include my View. In other words if I made a view called picView I should see picView as a choice along with view but I only see view.
Later, I find my delegate ViewController methods will not run. When I go back to make the link again, I find mysteriously that my view is now an option and that fixes the issue.
Here are two pictures that illustrate the issue.
Here there is no link available
Here there is a link available
Having gone through the process of creating an App specially to illustrate this point I have discovered that I was looking the wrong way round. Rather than Interface Builder Creating the Outlet I have to put it into the ViewController and then IB can use it to make the link.
This is achieved when I put the outlet into the interface of the ViewController.m file illustrated below. At that moment, the link appears in IB.
//
// SecondViewController.m
// Empty Test
//
// Created by Brian Lockwood on 07/09/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "SecondViewController.h"
#import "PicView.h"
#interface SecondViewController() <PicViewDataSourceDelegate>
#property (nonatomic, weak) IBOutlet PicView *picView; //<<<<<<<<< this line here
#end
I am attempting to follow this example: http://howtomakeiphoneapps.com/uiwebview-tutorial/239/
I have added a UIWebView into my view (using Storyboard)... I added the IBOutlet to my .h controller file. (see image at: http://imgur.com/GfUmC). I added a delegate to the view controller like this:
#import <UIKit/UIKit.h>
#interface slWebViewController : UIViewController <UIWebViewDelegate> {
IBOutlet UIWebView *slWebView;
}
#end
Since I'm using XCode 4, I don't know how to set the UIWebView's delegate to the File Owner, which is why I think this is what I'm getting a black screen. I'm missing something, but I don't know what. At this point, I would really, really appreciate any help I can get solving this...
In your Storyboard, right click (or ctrl-click) and drag from your UIWebView to the File's Owner on the left side, and choose "delegate".
Alternatively, select the webView (as in your image). Note the top outlet, "delegate". Drag from there to the File's Owner.
Or you can code it. In viewDidLoad, type "self.sIWebView.delegate = self;"
All of this is assuming that you have your URL request right. In case you don't, here's an example:
NSURL * url = [NSURL URLWithString:#"http://google.com"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: url
cachePolicy: NSURLRequestReloadIgnoringCacheData
timeoutInterval: 10];
[sIWebView loadRequest:request];
EDIT: If you are presenting the webView modally, add this code to the view controller that segues to your webview: -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.identifier isEqualToString:#"SegueIdentifier"]) { WebViewController *webView = segue.destinationViewController; webView.delegate = self; } } You'll need to add an identifier to your segue. Just click on the segue itself, go to the third tab from the right, and type in an identifier.
UPDATE: I've isolated the problem to the webViewConroller.m file. Everything is connected properly. If I place the loadRequest code in the viewController at viewDidLoad, I see Google. If I place the loadRequest code in the "webViewController", and mark the ViewContoller as a custom class of webViewController, I get the black screen. I'm wondering if there isn't a better way to get the UIWebView to display content? I really don't need a controller for the webView, just when the segue for that cell is tapped, display the contents of the UIWebView... not sure I can do it with XCode...