求教如何在百度地图上添加浮动按钮

2025-05-21 03:30:21
推荐回答(1个)
回答(1):

直接用addSubView添加的,
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setImage:[UIImage imageNamed:@"security-fenceLocation"] forState:UIControlStateNormal];
button.frame = CGRectMake(10.0, CGRectGetMaxY(_mapView.frame) - 90, 35.0, 35.0);
[self addSubview:button];