uiview - Howto Size the Modal View programmatically (SWIFT) -


i want present small option dialog on existing main uiviewcontroller/uiview , on ipad see small dialog , in background see main view.

i managed show uiviewcontroller/uiview in modal view style follow:

func showoptions(){      let storyboard = uistoryboard(name: "main", bundle: nil)     let controller = storyboard.instantiateviewcontrollerwithidentifier("options") as! uiviewcontroller      controller.modalpresentationstyle = uimodalpresentationstyle.popover      let popoverpresentationcontroller = controller.popoverpresentationcontroller      // result optional (but should not nil if modalpresentationstyle popover)     if let _popoverpresentationcontroller = popoverpresentationcontroller {          // set view pop         _popoverpresentationcontroller.sourceview = self.view;          //_popoverpresentationcontroller.sourcerect = cgrectmake(60, 100, 500, 500)         //_popoverpresentationcontroller. .setpopovercontentsize(cgsizemake(550, 600), animated: true)         //_popoverpresentationcontroller.sourceview.sizetofit();          // present (id iphone modal automatic full screen)         self.presentviewcontroller(controller, animated: true, completion: nil)     } } 

but have still issues: 1. howto rid of arrow shown @ border. 2. howto size modal view. shown small , fit largest controls in uicontrollerview/uiview.

any ?

  1. try changing _popoverpresentationcontroller.permittedarrowdirections empty option set
  2. change controller.preferredcontentsize match desired size

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -