gpt4 book ai didi

ios - iPad 版 BaseMAP 图库弹出窗口

转载 作者:行者123 更新时间:2023-11-29 01:13:57 26 4
gpt4 key购买 nike

我正在为 GIS 功能使用 ARCGIS 库,我想实现如下图所示的 basemap 库。

enter image description here

我怎样才能实现上面的画廊,我试图搜索示例代码但没有得到如上图所示的任何东西.....

如果可能的话,如果有人做过的话,可以给我引用示例代码的链接...将非常有帮助。

最佳答案

这是在 IPad 中弹出 galary 的代码

import UIKit

class ViewController: UIViewController,UIImagePickerControllerDelegate,UINavigationControllerDelegate,UIPopoverPresentationControllerDelegate {
var imagePicker = UIImagePickerController()
var popController:UIPopoverPresentationController!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


@IBAction func btn_action(sender: UIButton) {
if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.SavedPhotosAlbum) {

self.imagePicker.delegate = self
self.imagePicker.sourceType = UIImagePickerControllerSourceType.SavedPhotosAlbum
self.imagePicker.allowsEditing = true
imagePicker.modalPresentationStyle = UIModalPresentationStyle.Popover
self.presentViewController(self.imagePicker, animated: true, completion: nil)
popController = imagePicker.popoverPresentationController!
popController.permittedArrowDirections = UIPopoverArrowDirection.Up
popController.delegate = self
popController.sourceView = self.view
let contentSize : CGSize = CGSizeMake(500,400)
self.imagePicker.preferredContentSize = contentSize
popController.backgroundColor=UIColor.redColor()
popController.sourceRect = CGRectMake(sender.frame.origin.x + sender.bounds.width/2-5, sender.frame.origin.y+sender.bounds.size.height/2, 10, 10)
}
}

internal override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{
return UIInterfaceOrientationMask.Landscape
}
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject])
{

}
func imagePickerControllerDidCancel(picker: UIImagePickerController)
{
imagePicker.dismissViewControllerAnimated(true, completion: nil)
}
}

extension UIImagePickerController
{
public override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask
{
return UIInterfaceOrientationMask.Landscape
}
}

关于ios - iPad 版 BaseMAP 图库弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35449040/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com