Contents of UIPopoverController are blurry
I am presenting a UIPopoverController in my application but the content view is appearing slightly blurred.
To demonstrate, I placed a second instance of the content view controller directly onto self.view and it is easy to see by comparison that the text in the popover is fuzzy. This issue occurs both on the device and in the Simulator.
Screenshot:
Code:
// ...
// init the edit view controller
editSOViewController = [[EditViewController alloc]
initForNewObjectWithDict:dict];
// init popover with editSOViewController
UIPopoverController *popover = [[UIPopoverCo开发者_如何学Gontroller alloc]
initWithContentViewController:editSOViewController];
// set size
navPopover.popoverContentSize =
CGSizeMake(editSOViewController.view.frame.size.width,
[editSOViewController heightForViewControllerInPopoverView]);
// this is blurry
[popover presentPopoverFromRect:image.frame
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
// this is clear
editViewController *test =
[[EditViewController alloc] initForNewObjectWithDict:dict];
[self.view addSubview:test.view];
Any ideas for what could cause this? I thought that the UIPopover might be slightly shrinking the view, but I lined the two examples up with an image editor and there is no difference in size (but distinct "fuzz" in the popover view).
I still have the same problem if i use WEPopover (https://github.com/werner77/WEPopover/).
Thanks.
Using frame values with fractional parts causes positioning in-between pixels which results in blurriness.
To avoid it, set the frame values to numbers with no fractions by using functions such as round
or floor
.
精彩评论