标签: gmsautocomplete

如何为 iOS 自定义 GMSAutocompleteViewController?

我在 ios 中使用 Google 自动完成 placekicker。它向我展示了具有本机设计的控制器。我想自定义它的导航栏颜色。但我无法做到。下面是代码

        let autocompleteController = GMSAutocompleteViewController()
        autocompleteController.tintColor = UIColor.red
        autocompleteController.navigationController?.navigationBar.barTintColor = Constant.AppColor.navigationColor
        autocompleteController.delegate = self
        self.present(autocompleteController, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

xcode uicolor ios swift gmsautocomplete

8
推荐指数
2
解决办法
4055
查看次数

如何使用pod获取最新的GoogleMaps SDK

  1. 我正在尝试谷歌的地方sdk样本.我用它安装了它

pod尝试使用GoogleMaps

  1. 我使用cocoapods安装了GoogleMaps(1.10.5)

来源' https://github.com/CocoaPods/Specs.git '

平台:ios,'8.1'

pod'GoogleMaps'

在两个步骤中检查GoogleMaps,示例(1)中的一个包含更多标题,如GMSAutocompleteTableDataSource.h

在此输入图像描述

他们为什么不同?样本中的那个似乎是一个更好的版本,但pods给出的那个不是最新版本?它甚至不在更改日志中

google-maps ios google-places-api gmsautocomplete

5
推荐指数
2
解决办法
2991
查看次数

谷歌地图自动完成更改颜色

我正在寻找改变颜色的 GMSAutocompleteViewController

这是我得到的:

截屏

我希望文本字段为白色,带有白色取消按钮。

google-maps uitextfield ios swift gmsautocomplete

4
推荐指数
1
解决办法
5144
查看次数

Google Places iOS-无法加载搜索结果

我在我的iOS项目中使用了Google Places API的GMSAutoCompleteViewController。

今天突然,我的GMSAutoCompleteViewController继续给我错误“无法加载搜索结果”。

我已经使用新的API密钥重新生成了我的API密钥。我已经尝试了所有方法,但是仍然有些方法不起作用。

我正在使用Objective-C。有人可以帮忙吗?

GMSAutocompleteViewController *acController = [[GMSAutocompleteViewController alloc] init];
    acController.delegate = self;
[self.navigationController pushViewController:acController animated:YES];
Run Code Online (Sandbox Code Playgroud)

委托方法

- (void)viewController:(GMSAutocompleteViewController *)viewController
                didAutocompleteWithPlace:(GMSPlace *)place {
    // Do something with the selected place.
    NSLog(@"Place name %@", place.name);
    NSLog(@"Place address %@", place.formattedAddress);
    NSLog(@"Place attributions %@", place.attributions.string);
    NSLog(@"Latitude = %.20f",place.coordinate.latitude);
    NSLog(@"Longitude = %.20f",place.coordinate.longitude);
    NSLog(@"Type = %@",place.types);
    NSLog(@"Place ID = %@",place.placeID);
    //[self dismissViewControllerAnimated:YES completion:nil];
    [self.navigationController popViewControllerAnimated:YES];

    /* Call and API in background to get the address according to the new LAT AND LONG …
Run Code Online (Sandbox Code Playgroud)

google-maps ios google-places-api gmsautocomplete

4
推荐指数
2
解决办法
4413
查看次数

GMSAutocompletePrediction forecast.attributedFullText不在swift 3.0中给出nsmutablestring

我在swift项目中使用GMSAutocompleteFetcher来搜索地点.在这里,我使用pod安装'GooglePlaces''GooglePlacePicker''GoogleMaps',并在链接https://developers.google.com/places/ios-api/autocomplete#use_the_fetcher中编写所有内容, 但在textFieldDidChange中写入后,我得到的结果是它在委托方法中:

func didAutocomplete(with predictions: [GMSAutocompletePrediction]) {
        let resultsStr = NSMutableString()
        for prediction in predictions {
            resultsStr.appendFormat("%@\n", prediction.attributedFullText)

        }
Run Code Online (Sandbox Code Playgroud)

但在resultsStr得到的价值:

 Ca{
    GMSAutocompleteMatch = "<GMSAutocompleteMatchFragment: 0x608000223940>";
}lifornia{
}
Run Code Online (Sandbox Code Playgroud)

应该是"加利福尼亚"

ios google-places-api swift3 gmsautocomplete

2
推荐指数
1
解决办法
964
查看次数