UA-17470720-3

Jump to content


Photo
- - - - -

Difficulty with popovers


  • Please log in to reply
17 replies to this topic

#1 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:18 PM

Dear Sensiblecocoans,

I'm having some issues with popovers, I've created a sample project for you to look at that I will attach to this thread.

I'm working on a project that requires tag management and selection.

I've created two view controllers. One which allows the user to create and delete tags (called TagManagementController in the sample project), and one which allows the user to select tags (called TagSelectionController in the sample project).

In the full project TagSelectionController has other options at the top level but in this example is just has a selection cell which takes the user to a list of tags.

The problems are these:

- In the TagManagementController the 'edit' button doesn't work but more importantly (although I suspect related), when a modal controller is presented the navigation bar in the modal controller is see-through and when the modal controller is dismissed the navigation bar for the top-level view is gone.

- In the TagSelectionController when the selection cell is displayed, the border for the popover is enlarged and the new controller is displayed with an offset.

I'm going to attach the sample project now and then I'll try to attach some screenshots showing what's going on. [file name=popovertestsNoSTV.zip size=30501]http://www.sensiblec...rtestsNoSTV.zip[/file]

#2 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:23 PM

Here's what the tag management popover looks like when it is first presented. In this case a tag with an empty name has been selected.


Posted Image

#3 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:28 PM

The '+' button has been pressed and you can see the detail view that is presented using CurrentContext, if you look closely at the navigation bar you'll see that it seems to be transparent.


Posted Image

#4 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:31 PM

Now the detail controller has been dismissed and you can see that the navigation bar for the top level view is gone. Posted Image

#5 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:32 PM

This is what the top level of the tag selection controller looks like. In the real project there are other options present here too so it's not an option to go straight into tag selection. That's why a selection cell is used. Posted Image

#6 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:34 PM

When the 'tags' cell is tapped and as the new controller is displayed the borders of the popover are corrupted. This is what they end up looking like:



Posted Image

#7 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 26 October 2010 - 08:35 PM

The corrupted borders remain even after the selection controller is dismissed: Posted Image

#8 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 27 October 2010 - 01:03 PM

Dear Emiliano,

Thank you very much for providing the attached example and all the screen shots, we really appreciate it.

We've been doing many tests on this now and it seems that this only happens if the view controller containing STV is inside a popover. The same "TagManagementController" and "TagSelectionController" you have in your project would work flawlessly if they're not displayed inside a popover. For some reason, when inside a popover, the navigation bar is transparent and has the same problems as in your screen shot. We will further investigate this and get back to you ASAP.

One more thing: regarding the edit button issue, since your view controller is not a UITableViewController, you just need to tell STV about your edit button using the following code:

...
tableModel.editButtonItem = self.navigationItem.leftBarButtonItem;
...

Thanks a lot Emiliano.

#9 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 27 October 2010 - 04:35 PM

Thank you for the edit button help. I hadn't picked up on the need for that.

#10 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 31 October 2010 - 07:43 PM

Any updates on this one? I've just tried it on iOS 4.2 on the iPad and the issue is still there.

#11 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 01 November 2010 - 10:01 AM

Hi Emiliano,

We're having our next minor release on Fri, and we are working really hard to have a fix for this issue by then. Thanks!

#12 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 01 November 2010 - 02:13 PM

Thank you! I'm not in an incredible hurry, I just wanted to know if it WAS possible to fix and if you were still looking at it.

#13 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 05 November 2010 - 02:02 PM

Hi again Emiliano,

I am just updating you with our findings to date:

1- The popover transparency issue: we found that the navigationController.navigationBar.barStyle of the popover's navigation controller has a value of 3, while, as per Apple's documentation, a UIBarStyle should be between 0 and 2 (even 2 is deprecated, so it should be either 0 or 1). Sensible TableView inherits this style in its detail views, which explains the odd behavior. We're working on figuring out why the bar style of a popover's nav controller is taking this value.

2- The popover misalignment issue: There is a piece of the code you sent that we need more clarification about:

-(IBAction)tagManagementControllerRequested{

	tagManagementPopoverController=[[[UIPopoverController alloc] initWithContentViewController:tagManagementNavigationController] retain];//tagManagementNavigationController] retain];	
	tagManagementPopoverController.popoverContentSize=CGSizeMake(320, 480);
	tagManagementController.contentSizeForViewInPopover=CGSizeMake(320, 436);			
	
	[tagManagementPopoverController presentPopoverFromRect:requestTagManagementControllerButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];	
	
}

How did you arrive at the numbers 480 versus 436?

Thanks a lot, we will keep updating you.

#14 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 06 November 2010 - 03:21 AM

Ah right! you can forget about the 480/436 difference, it's a copy/paste error and a result of some experimentation I did on my full project.

It HAD to do with stopping the resize of the 'tag selection' popover when pressing 'Done' after entering the 'tags' detail view.

Thanks for letting me know what's happening.

#15 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 07 December 2010 - 04:45 AM

I am just updating this post with our findings: This has turned out to be a bug on Apple's side, and Emiliano has already filed a bug report with Apple.

Any news on that Emiliano?

#16 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 07 December 2010 - 04:49 AM

No, nothing yet. I may have to use a support incident for it.

#17 Emiliano Molina

Emiliano Molina

    Experienced Member

  • STV 5.0 Pro
  • PipPipPipPip
  • 54 posts
Reputation: 5
Good

Posted 06 January 2011 - 06:17 PM

Well, Apple didn't come through with a fix but Tarek sure did!

He worked out a way to get around the Apple bug (and it IS an Apple bug) and has provided me with an updated beta containing changes that I suspect you will all get soon.

So remember, if your app displays objects on the screen (including core data backed ones) and you want to set up a way to configure properties on those objects, popovers and STV are you dear, dear friends.

#18 Tarek

Tarek

    Forum Admin

  • Administrators
  • 3670 posts
Reputation: 452
Popular

Posted 07 January 2011 - 05:22 AM

Thanks a lot Emiliano for all your feedback :)

We are now able to further confirm this. We've done several tests and everything seems to be working really well. To be able to overcome this bug, STV requires that the main view of the popover is a UINavigationController. STV will then take it from there and will do some internal plumbing work to override the bug.

This fix will be part of our STV 2.0 final release.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users