2016-02-17 8 views
0

J'utilise bibliothèque ARCGIS pour les fonctionnalités SIG, je veux réaliser la galerie de fond de carte comme le montre un dans l'image ci-dessous.BaseMAP Galerie Popup pour iPad

enter image description here

comment puis-je obtenir au-dessus de la galerie, j'ai essayé de chercher des exemples de code, mais n'a pas obtenu quelque chose comme montré ci-dessus dans l'image .....

si possible, si quelqu'un a fait peut donner moi le lien pour référencer le code exemple ... sera très utile.

Répondre

1

Voici un code pour pop-up galary dans IPad

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 
    } 
}