Mapbox iOS移动归因按钮 [英] Mapbox iOS move attribution Button

查看:68
本文介绍了Mapbox iOS移动归因按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mapbox SDK,需要显示其徽标水印和其归属标记.不过,我可以移动它们,因此我想将归因按钮从徽标水印旁边的右下角移到左下角.

I'm using the mapbox SDK and I need to show their logo watermark and their attribution mark. I can move them though, so I want to move the attribution button from the bottom right to bottom left next to the logo watermark.

我尝试了以下代码,但没有用:

I tried the following code but it did not work:

func mapViewWillStartLoadingMap(_ mapView: MGLMapView) {
    mapView.attributionButton.frame.offsetBy(dx: -200.0, dy: 0)
}

它是这样的:

推荐答案

mapView.attributionButton.contentHorizontalAlignment = .left
mapView.attributionButton.frame.size = CGSize(width:   self.mapView.frame.size.width - 120, height: 25)

您还可以按以下方式隐藏归因按钮:

you can also hide attribution Button as follow:

mapView.attributionButton.alpha = 0

这篇关于Mapbox iOS移动归因按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆