Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/96.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在googleMapView顶部添加一个按钮_Ios_Swift_Xcode_Google Maps - Fatal编程技术网

Ios 在googleMapView顶部添加一个按钮

Ios 在googleMapView顶部添加一个按钮,ios,swift,xcode,google-maps,Ios,Swift,Xcode,Google Maps,我正试图在googleMapView上添加一个UiButton 我想用另一个按钮打开我的谷歌地图应用程序,从我的应用程序进行导航 我尝试以编程方式添加一个按钮并使用xib。。这不是双向的。(未显示) 你们知道吗。我正在使用swift尝试将按钮添加为子视图 创建如下按钮: let button = UIButton() button.backgroundColor = .blue button.frame = CGRect(x: 0, y: 0, width: view.frame.width,

我正试图在googleMapView上添加一个UiButton

我想用另一个按钮打开我的谷歌地图应用程序,从我的应用程序进行导航

我尝试以编程方式添加一个按钮并使用xib。。这不是双向的。(未显示)


你们知道吗。我正在使用swift

尝试将按钮添加为子视图

创建如下按钮:

let button = UIButton()
button.backgroundColor = .blue
button.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 50)
button.setTitle("My Button", for: .normal)
googleMapView.addSubview(button)
并将其作为子视图添加到
谷歌地图视图中,如下所示:

let button = UIButton()
button.backgroundColor = .blue
button.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: 50)
button.setTitle("My Button", for: .normal)
googleMapView.addSubview(button)

当我用谷歌
Swift在谷歌地图视图上添加一个按钮时,似乎有很多有用的结果,你都试过了吗?如果是的话,你能澄清一下你做了哪些尝试,哪些没有成功吗?如果那些成功了,我不会发这个帖子:)好吧,很多人都做了,很难区分谁事先谷歌搜索过,谁没有。为了避免人们重复其他问题中的所有建议(这对您没有帮助),请添加一些您已经尝试过的方法的详细信息。谢谢